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
|
|
|
####################################################################################################
|
2023-08-23 06:45:32 +00:00
|
|
|
FROM golang:bookworm as wireguard
|
|
|
|
ARG wg_go_tag=0.0.20230223
|
|
|
|
ARG wg_tools_tag=v1.0.20210914
|
2021-05-19 18:16:28 +00:00
|
|
|
|
2021-09-18 07:15:29 +00:00
|
|
|
RUN mkdir /repo \
|
2023-08-23 06:45:32 +00:00
|
|
|
&& curl -L https://github.com/WireGuard/wireguard-go/archive/refs/tags/0.0.20230223.tar.gz \
|
2021-09-18 07:15:29 +00:00
|
|
|
| tar -xzC /repo --strip-components=1 \
|
|
|
|
&& cd /repo \
|
2023-08-23 06:45:32 +00:00
|
|
|
&& CGO_ENABLED=0 make
|
2021-05-19 18:16:28 +00:00
|
|
|
|
2021-04-19 12:56:18 +00:00
|
|
|
####################################################################################################
|
|
|
|
## Final image
|
|
|
|
####################################################################################################
|
2023-08-23 06:45:32 +00:00
|
|
|
FROM rust:slim-bookworm
|
2021-06-09 18:27:38 +00:00
|
|
|
RUN apt-get update && \
|
2024-07-01 01:16:43 +00:00
|
|
|
apt-get install -y --no-install-recommends libsqlite3-dev iproute2 iputils-ping build-essential clang libclang-dev libselinux1-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 . .
|
2024-07-01 01:16:43 +00:00
|
|
|
RUN cargo build --features client/selinux \
|
2021-09-18 07:15:29 +00:00
|
|
|
&& 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"]
|