Merge pull request #83 from tofay/chown

Use "ADD --chown" examples
This commit is contained in:
Eric Kidd 2020-01-26 07:58:55 -05:00 committed by GitHub
commit 441e6222bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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