Fix creation of dummy user
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Valentin Brandl 2019-07-24 18:05:11 +02:00
parent 9ead204010
commit 623e9c50d2
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -1,8 +1,5 @@
FROM ekidd/rust-musl-builder:stable as builder FROM ekidd/rust-musl-builder:stable as builder
# RUN adduser -D hoc
RUN useradd -u 10001 dummy
# create new cargo project # create new cargo project
RUN USER=rust cargo init --bin RUN USER=rust cargo init --bin
# copy build config # copy build config
@ -17,9 +14,14 @@ COPY ./src ./src
# build source code # build source code
RUN cargo build --release RUN cargo build --release
# create /etc/password for rootless scratch container
FROM alpine:latest as user_builder
RUN USER=root adduser -D -u 10001 dummy
FROM scratch FROM scratch
COPY --from=builder /etc/passwd /etc/passwd COPY --from=user_builder /etc/passwd /etc/passwd
USER dummy USER dummy
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/gitache / COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/gitache /