Add dumb-init to Docker image

This commit is contained in:
Aram 🍐 2021-10-16 13:40:11 -04:00
parent bb85d95a83
commit 6854a56d5f
2 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,4 @@
FROM rust:1.55 as cargo-build
RUN apt-get update
WORKDIR /usr/src/onetun
COPY Cargo.toml Cargo.toml
@ -15,11 +14,12 @@ COPY . .
RUN cargo build --release
FROM debian:11-slim
RUN apt-get update
RUN apt-get install dumb-init -y
COPY --from=cargo-build /usr/src/onetun/target/release/onetun /usr/local/bin/onetun
# Run as non-root
RUN chown 1000 /usr/local/bin/onetun
USER 1000
ENTRYPOINT ["/usr/local/bin/onetun"]
ENTRYPOINT ["dumb-init", "/usr/local/bin/onetun"]