From 8d66428bebf3f2f595fb138c804f0c747917e399 Mon Sep 17 00:00:00 2001 From: Valkum Date: Thu, 17 Sep 2020 12:50:37 +0200 Subject: [PATCH] Add intermediate container to hide ARGs ARGs contain secrets to speed up builds --- tests/Complement.Dockerfile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/Complement.Dockerfile b/tests/Complement.Dockerfile index 56e4bf7..35b3324 100644 --- a/tests/Complement.Dockerfile +++ b/tests/Complement.Dockerfile @@ -1,10 +1,21 @@ -FROM valkum/docker-rust-ci:latest +FROM valkum/docker-rust-ci:latest as builder WORKDIR /build +ARG RUSTC_WRAPPER +ARG AWS_ACCESS_KEY_ID +ARG AWS_SECRET_ACCESS_KEY +ARG SCCACHE_BUCKET +ARG SCCACHE_ENDPOINT +ARG SCCACHE_S3_USE_SSL + COPY . . RUN cargo build +FROM valkum/docker-rust-ci:latest +WORKDIR /build +COPY --from=builder /build/target/debug/conduit /conduit + ENV SERVER_NAME=localhost EXPOSE 14004 8448 -CMD sed "s/server_name: your.server.name/server_name: ${SERVER_NAME}/g" Rocket-example.toml Rocket.toml && ./target/debug/conduit \ No newline at end of file +CMD sed "s/server_name: your.server.name/server_name: ${SERVER_NAME}/g" Rocket-example.toml Rocket.toml && /conduit \ No newline at end of file