mirror of
https://github.com/aramperes/onetun.git
synced 2025-09-08 23:58:31 -04:00
Dockerize, and switch back to main boringtun repo
This commit is contained in:
parent
006a1b0b4e
commit
b4317dad1a
6 changed files with 51 additions and 4 deletions
25
Dockerfile
Normal file
25
Dockerfile
Normal file
|
@ -0,0 +1,25 @@
|
|||
FROM rust:1.55 as cargo-build
|
||||
RUN apt-get update
|
||||
|
||||
WORKDIR /usr/src/onetun
|
||||
COPY Cargo.toml Cargo.toml
|
||||
|
||||
# Placeholder to download dependencies and cache them using layering
|
||||
RUN mkdir src/
|
||||
RUN echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs
|
||||
RUN cargo build --release
|
||||
RUN rm -f target/x86_64-unknown-linux-musl/release/deps/myapp*
|
||||
|
||||
# Build the actual project
|
||||
COPY . .
|
||||
RUN cargo build --release
|
||||
|
||||
FROM debian:11-slim
|
||||
|
||||
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"]
|
Loading…
Add table
Add a link
Reference in a new issue