2023-08-30 14:59:54 +08:00
|
|
|
####################################################################################################
|
|
|
|
## Builder
|
|
|
|
####################################################################################################
|
|
|
|
FROM rust:latest AS builder
|
|
|
|
|
|
|
|
WORKDIR /worker
|
|
|
|
COPY ./ .
|
|
|
|
RUN cargo build --release --target x86_64-unknown-linux-gnu
|
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
## Final image
|
|
|
|
####################################################################################################
|
|
|
|
FROM ubuntu:latest
|
|
|
|
|
2023-10-29 23:01:06 +01:00
|
|
|
RUN apt update && apt install -y iproute2 && apt clean all
|
2023-08-30 14:59:54 +08:00
|
|
|
|
|
|
|
COPY --from=builder /worker/target/x86_64-unknown-linux-gnu/release/tun2proxy /usr/bin/tun2proxy
|
|
|
|
|
2023-10-29 23:01:06 +01:00
|
|
|
ENTRYPOINT ["/usr/bin/tun2proxy", "--setup", "auto"]
|