Use ADD --chown
This commit is contained in:
parent
d4fba1d396
commit
8f2936c318
|
@ -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
|
||||||
```
|
```
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue