From 8f2936c318aa8c5a42a15846746626f426764fcb Mon Sep 17 00:00:00 2001 From: Tom Fay Date: Wed, 13 Nov 2019 10:14:16 +0000 Subject: [PATCH] Use ADD --chown --- README.md | 3 +-- examples/linking-with-git2/Dockerfile | 5 +---- examples/using-diesel/Dockerfile | 5 +---- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3d1b28f..5d9e049 100644 --- a/README.md +++ b/README.md @@ -158,8 +158,7 @@ FROM ekidd/rust-musl-builder # We need to add the source code to the image because `rust-musl-builder` # assumes a UID of 1000, but TravisCI has switched to 2000. -ADD . ./ -RUN sudo chown -R rust:rust . +ADD --chown=rust:rust . ./ CMD cargo build --release ``` diff --git a/examples/linking-with-git2/Dockerfile b/examples/linking-with-git2/Dockerfile index 114a594..d0e89fb 100644 --- a/examples/linking-with-git2/Dockerfile +++ b/examples/linking-with-git2/Dockerfile @@ -7,10 +7,7 @@ FROM ekidd/rust-musl-builder AS builder # Add our source code. -ADD . ./ - -# Fix permissions on source code. -RUN sudo chown -R rust:rust /home/rust +ADD --chown=rust:rust . ./ # Build our application. RUN cargo build diff --git a/examples/using-diesel/Dockerfile b/examples/using-diesel/Dockerfile index 634a521..7aa1d1d 100644 --- a/examples/using-diesel/Dockerfile +++ b/examples/using-diesel/Dockerfile @@ -11,10 +11,7 @@ ARG BASE_IMAGE=ekidd/rust-musl-builder:latest FROM ${BASE_IMAGE} AS builder # Add our source code. -ADD . ./ - -# Fix permissions on source code. -RUN sudo chown -R rust:rust /home/rust +ADD --chown=rust:rust . ./ # Build our application. RUN cargo build --release