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

View file

@ -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): You can also run onetun using [Docker](https://hub.docker.com/r/aramperes/onetun):
```shell ```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...] 0.0.0.0:8080 192.168.4.2:8080 [...options...]
``` ```