Use ADD --chown

This commit is contained in:
Tom Fay 2019-11-13 10:14:16 +00:00
parent d4fba1d396
commit 8f2936c318
3 changed files with 3 additions and 10 deletions

View file

@ -158,8 +158,7 @@ FROM ekidd/rust-musl-builder
# We need to add the source code to the image because `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. # assumes a UID of 1000, but TravisCI has switched to 2000.
ADD . ./ ADD --chown=rust:rust . ./
RUN sudo chown -R rust:rust .
CMD cargo build --release CMD cargo build --release
``` ```

View file

@ -7,10 +7,7 @@
FROM ekidd/rust-musl-builder AS builder FROM ekidd/rust-musl-builder AS builder
# Add our source code. # Add our source code.
ADD . ./ ADD --chown=rust:rust . ./
# Fix permissions on source code.
RUN sudo chown -R rust:rust /home/rust
# Build our application. # Build our application.
RUN cargo build RUN cargo build

View file

@ -11,10 +11,7 @@ ARG BASE_IMAGE=ekidd/rust-musl-builder:latest
FROM ${BASE_IMAGE} AS builder FROM ${BASE_IMAGE} AS builder
# Add our source code. # Add our source code.
ADD . ./ ADD --chown=rust:rust . ./
# Fix permissions on source code.
RUN sudo chown -R rust:rust /home/rust
# Build our application. # Build our application.
RUN cargo build --release RUN cargo build --release