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`
# 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
```

View file

@ -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

View file

@ -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