This repository has been archived on 2024-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
clear-docker-images/Earthfile

39 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-03-05 16:25:59 +01:00
VERSION 0.6
FROM rust:1.59
ARG VERSION
ARG DOCKER_IMG
2022-08-26 13:08:47 +02:00
ARG GITEA_IMG
2022-03-05 16:25:59 +01:00
WORKDIR /clear-docker-images
build-linux:
COPY . .
2022-03-06 04:29:22 +01:00
RUN rustup target add x86_64-unknown-linux-musl
2022-03-16 13:48:55 +01:00
2022-03-16 13:58:58 +01:00
RUN cargo build --release --all-features --target x86_64-unknown-linux-gnu
RUN cargo build --release --all-features --target x86_64-unknown-linux-musl
2022-03-16 13:48:55 +01:00
SAVE ARTIFACT target/x86_64-unknown-linux-gnu /x86_64-unknown-linux-gnu AS LOCAL target/x86_64-unknown-linux-gnu
2022-03-06 04:29:22 +01:00
SAVE ARTIFACT target/x86_64-unknown-linux-musl /x86_64-unknown-linux-musl AS LOCAL target/x86_64-unknown-linux-musl
2022-03-05 16:25:59 +01:00
build-images:
2022-03-16 13:48:55 +01:00
FROM gcr.io/distroless/static-debian11
2022-03-05 16:25:59 +01:00
2022-08-26 13:08:47 +02:00
LABEL maintainer="Antoine Langlois <antoine.l@antoine-langlois>"
LABEL repository="https://gitea.antoine-langlois.net/DataHearth/clear-docker-images"
LABEL org.opencontainers.image.source=&quot;https://gitea.antoine-langlois.net/DataHearth/clear-docker-images&quot;
2022-03-05 16:25:59 +01:00
2022-03-16 13:48:55 +01:00
COPY +build-linux/x86_64-unknown-linux-musl/release/clear-docker-images /usr/local/bin/clear-docker-images
2022-03-05 16:25:59 +01:00
VOLUME ["/var/run/docker.sock"]
ENTRYPOINT ["clear-docker-images"]
2022-03-06 23:34:09 +01:00
SAVE IMAGE --push ${DOCKER_IMG}:${VERSION}
SAVE IMAGE --push ${DOCKER_IMG}:latest
2022-08-26 13:08:47 +02:00
SAVE IMAGE --push ${GITEA_IMG}:${VERSION}
SAVE IMAGE --push ${GITEA_IMG}:latest