From 6854a56d5f71ba190a4867273f82fe0482c071e5 Mon Sep 17 00:00:00 2001 From: Aram Peres Date: Sat, 16 Oct 2021 13:40:11 -0400 Subject: [PATCH] Add dumb-init to Docker image --- Dockerfile | 6 +++--- README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd01361..9edc22a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index 10866d0..20f32e7 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ the [Releases](https://github.com/aramperes/onetun/releases) page. You can also run onetun using [Docker](https://hub.docker.com/r/aramperes/onetun): ```shell -docker run --rm --init --name onetun -p 8080:8080 aramperes/onetun \ +docker run --rm --name onetun --user 1000 -p 8080:8080 aramperes/onetun \ 0.0.0.0:8080 192.168.4.2:8080 [...options...] ```