Dockerfile 386 B

12345678910111213
  1. FROM rust:alpine as builder
  2. RUN apk add --no-cache musl-dev openssl openssl-dev pkgconfig
  3. WORKDIR /home/rust/src
  4. COPY . .
  5. RUN cargo build --locked --release --features client,server,noise,hot-reload
  6. RUN mkdir -p build-out/
  7. RUN cp target/release/rathole build-out/
  8. FROM scratch
  9. WORKDIR /app
  10. COPY --from=builder /home/rust/src/build-out/rathole .
  11. USER 1000:1000
  12. ENTRYPOINT ["./rathole"]