mirror of
https://github.com/dndx/phantun.git
synced 2025-01-18 22:09:30 +08:00
chore(docker): use Debian as base image (#108)
Alpine has worse performance and musl does not work well with Rust `libc` version `3`, use Debian instead.
This commit is contained in:
parent
1f11d618e0
commit
ee0bce0a96
@ -5,30 +5,22 @@
|
|||||||
#
|
#
|
||||||
# Build stage
|
# Build stage
|
||||||
#
|
#
|
||||||
FROM rust:alpine AS builder
|
FROM rust:latest AS builder
|
||||||
|
|
||||||
COPY . /phantun
|
COPY . /phantun
|
||||||
|
|
||||||
RUN apk update \
|
RUN cd phantun \
|
||||||
&& apk add --no-cache --virtual .build-deps musl-dev \
|
|
||||||
&& cd phantun \
|
|
||||||
&& cargo build --release \
|
&& cargo build --release \
|
||||||
&& strip target/release/server target/release/client \
|
&& strip target/release/server target/release/client \
|
||||||
&& install target/release/server /usr/local/bin/phantun-server \
|
&& install target/release/server /usr/local/bin/phantun-server \
|
||||||
&& install target/release/client /usr/local/bin/phantun-client \
|
&& install target/release/client /usr/local/bin/phantun-client \
|
||||||
&& cd - \
|
&& cd - \
|
||||||
&& rm -r phantun \
|
&& rm -r phantun
|
||||||
&& apk del .build-deps \
|
|
||||||
&& rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Runtime stage
|
# Runtime stage
|
||||||
#
|
#
|
||||||
FROM alpine:3.16
|
FROM debian:latest
|
||||||
|
|
||||||
RUN apk update \
|
|
||||||
&& apk add --no-cache iptables ip6tables tzdata \
|
|
||||||
&& rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
COPY --from=builder /usr/local/bin/phantun-server /usr/local/bin/
|
COPY --from=builder /usr/local/bin/phantun-server /usr/local/bin/
|
||||||
COPY --from=builder /usr/local/bin/phantun-client /usr/local/bin/
|
COPY --from=builder /usr/local/bin/phantun-client /usr/local/bin/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user