2021-04-19 12:56:18 +00:00
|
|
|
####################################################################################################
|
2021-09-18 07:15:29 +00:00
|
|
|
## WireGuard
|
2021-04-19 12:56:18 +00:00
|
|
|
####################################################################################################
|
2021-05-19 18:16:28 +00:00
|
|
|
FROM golang:latest as wireguard
|
|
|
|
ARG wg_go_tag=0.0.20210323
|
|
|
|
ARG wg_tools_tag=v1.0.20210315
|
|
|
|
|
2021-09-18 07:15:29 +00:00
|
|
|
RUN mkdir /repo \
|
|
|
|
&& curl -L https://github.com/WireGuard/wireguard-go/archive/refs/tags/0.0.20210424.tar.gz \
|
|
|
|
| tar -xzC /repo --strip-components=1 \
|
|
|
|
&& cd /repo \
|
|
|
|
&& make
|
2021-05-19 18:16:28 +00:00
|
|
|
|
2021-04-19 12:56:18 +00:00
|
|
|
####################################################################################################
|
|
|
|
## Final image
|
|
|
|
####################################################################################################
|
2021-09-18 07:15:29 +00:00
|
|
|
FROM rust:slim
|
2021-06-09 18:27:38 +00:00
|
|
|
RUN apt-get update && \
|
2021-09-18 07:15:29 +00:00
|
|
|
apt-get install -y --no-install-recommends libsqlite3-dev iproute2 iputils-ping build-essential clang libclang-dev && \
|
2021-06-09 18:27:38 +00:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2021-04-19 12:56:18 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2021-09-18 07:15:29 +00:00
|
|
|
COPY . .
|
|
|
|
RUN cargo build \
|
|
|
|
&& strip /app/target/debug/innernet /app/target/debug/innernet-server \
|
|
|
|
&& cp /app/target/debug/innernet /app/target/debug/innernet-server /usr/bin/ \
|
|
|
|
&& cargo clean
|
|
|
|
|
2021-04-19 12:56:18 +00:00
|
|
|
COPY ./docker-tests/start-client.sh ./
|
2021-09-15 13:57:48 +00:00
|
|
|
COPY ./docker-tests/start-server.sh ./
|
2021-09-18 07:15:29 +00:00
|
|
|
COPY --from=wireguard /repo/wireguard-go /usr/bin/
|
2021-04-19 12:56:18 +00:00
|
|
|
|
2021-09-15 13:57:48 +00:00
|
|
|
CMD ["/app/start-server.sh"]
|