From 82250df544b398004d1cccf0c50891f37565d173 Mon Sep 17 00:00:00 2001 From: dnomd343 Date: Thu, 18 Aug 2022 01:30:22 +0800 Subject: [PATCH] build: compile of radvd --- Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c18aa34..7a2c26d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,20 +10,27 @@ RUN make -C ./src/ && mkdir -p /upx/bin/ && mv ./src/upx.out /upx/bin/upx && \ FROM golang:1.18-alpine3.16 AS xray ENV XRAY_VERSION="1.5.9" -RUN wget https://github.com/XTLS/Xray-core/archive/refs/tags/v${XRAY_VERSION}.tar.gz && \ - tar xf v${XRAY_VERSION}.tar.gz +RUN wget https://github.com/XTLS/Xray-core/archive/refs/tags/v${XRAY_VERSION}.tar.gz && tar xf v${XRAY_VERSION}.tar.gz WORKDIR ./Xray-core-${XRAY_VERSION}/ RUN go mod download -x RUN env CGO_ENABLED=0 go build -v -o xray -trimpath -ldflags "-s -w" ./main && mv ./xray /tmp/ COPY --from=upx /upx/ /usr/ RUN upx -9 /tmp/xray +FROM alpine:3.16 AS radvd +ENV RADVD_VERSION="2.19" +RUN apk add build-base byacc flex-dev linux-headers +RUN wget https://radvd.litech.org/dist/radvd-${RADVD_VERSION}.tar.xz && tar xf radvd-${RADVD_VERSION}.tar.xz +WORKDIR ./radvd-${RADVD_VERSION}/ +RUN ./configure && make && mv ./radvd ./radvdump /tmp/ && strip /tmp/radvd* + FROM alpine:3.16 AS asset RUN apk add xz WORKDIR /tmp/ RUN wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" RUN wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat" RUN mkdir -p /asset/ && tar cJf /asset/assets.tar.xz ./*.dat +COPY --from=radvd /tmp/radvd* /asset/usr/sbin/ COPY --from=xray /tmp/xray /asset/usr/bin/ FROM alpine:3.16