Browse Source

build: update docker image

dev
Dnomd343 2 years ago
parent
commit
4e6b8f9ca2
  1. 429
      Dockerfile

429
Dockerfile

@ -1,5 +1,5 @@
ARG ALPINE_IMG="alpine:3.16" ARG ALPINE_IMG="alpine:3.16"
ARG RUST_IMG="rust:1.63-alpine3.16" ARG RUST_IMG="rust:1.64-alpine3.16"
ARG GO14_IMG="golang:1.14-alpine3.13" ARG GO14_IMG="golang:1.14-alpine3.13"
ARG GO16_IMG="golang:1.16-alpine3.15" ARG GO16_IMG="golang:1.16-alpine3.15"
ARG GO17_IMG="golang:1.17-alpine3.16" ARG GO17_IMG="golang:1.17-alpine3.16"
@ -10,52 +10,53 @@ ARG PYTHON_IMG="python:3.10-alpine3.16"
# Download build-base # Download build-base
FROM ${ALPINE_IMG} AS build-base FROM ${ALPINE_IMG} AS build-base
WORKDIR /apk/ WORKDIR /apk/
RUN echo "apk add --no-network \\" > ./build-base && chmod +x ./build-base && \ RUN echo -e "cd \`dirname \$0\`\napk add --no-network \\" > setup && chmod +x setup && \
apk update && apk fetch -R build-base | grep -oE '\S+$' | awk '{print "/apk/"$0".apk \\"}' >> ./build-base apk update && apk fetch -R build-base cmake | grep -oE '\S+$' | awk '{print "./"$0".apk \\"}' >> setup
# Compile python3 module numpy # Compile python3 module numpy
FROM ${PYTHON_IMG} AS numpy FROM ${PYTHON_IMG} AS numpy
WORKDIR /wheels/
COPY --from=build-base /apk/ /apk/ COPY --from=build-base /apk/ /apk/
RUN /apk/build-base && pip wheel numpy WORKDIR /wheels/
RUN /apk/setup && pip wheel numpy
# Compile python3 module gevent # Compile python3 module gevent
FROM ${PYTHON_IMG} AS gevent FROM ${PYTHON_IMG} AS gevent
WORKDIR /wheels/
RUN apk add libffi-dev RUN apk add libffi-dev
COPY --from=build-base /apk/ /apk/ COPY --from=build-base /apk/ /apk/
RUN /apk/build-base && pip wheel gevent WORKDIR /wheels/
RUN /apk/setup && pip wheel gevent
# Build python3 wheels # Build python3 wheels
FROM ${PYTHON_IMG} AS wheels FROM ${PYTHON_IMG} AS wheels
WORKDIR /wheels/
RUN apk add linux-headers RUN apk add linux-headers
COPY --from=build-base /apk/ /apk/ COPY --from=build-base /apk/ /apk/
RUN /apk/build-base && pip wheel colorlog flask IPy psutil pysocks pyyaml requests salsa20 WORKDIR /wheels/
RUN /apk/setup && pip wheel colorlog flask IPy psutil pysocks pyyaml requests salsa20
COPY --from=gevent /wheels/*.whl /wheels/ COPY --from=gevent /wheels/*.whl /wheels/
COPY --from=numpy /wheels/*.whl /wheels/ COPY --from=numpy /wheels/*.whl /wheels/
# Compile upx (use gcc10 for now) # Compile upx
FROM ${ALPINE_IMG} AS upx FROM ${ALPINE_IMG} AS upx
ENV UPX_VERSION="3.96" COPY --from=build-base /apk/ /apk/
RUN sed -i 's/v3.\d\d/v3.15/' /etc/apk/repositories && apk add bash build-base perl ucl-dev zlib-dev RUN apk add git && /apk/setup
RUN wget https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-src.tar.xz && tar xf upx-${UPX_VERSION}-src.tar.xz RUN git clone https://github.com/dnomd343/upx.git
WORKDIR ./upx-${UPX_VERSION}-src/ WORKDIR ./upx/
RUN make -C ./src/ && mkdir -p /upx/bin/ && mv ./src/upx.out /upx/bin/upx && \ RUN git submodule update --init && rm -rf ./.git/
mkdir -p /upx/lib/ && cd /usr/lib/ && cp -d ./libgcc_s.so* ./libstdc++.so* ./libucl.so* /upx/lib/ RUN make UPX_CMAKE_CONFIG_FLAGS=-DCMAKE_EXE_LINKER_FLAGS=-static && \
mv ./build/release/upx /tmp/ && strip /tmp/upx
# Compile shadowsocks-rust # Compile shadowsocks-rust
FROM ${RUST_IMG} AS ss-rust FROM ${RUST_IMG} AS ss-rust
ENV SS_RUST="1.15.0-alpha.8" ENV SS_RUST="1.15.0-alpha.8"
COPY --from=build-base /apk/ /apk/ COPY --from=build-base /apk/ /apk/
RUN /apk/build-base && \ RUN wget https://github.com/shadowsocks/shadowsocks-rust/archive/refs/tags/v${SS_RUST}.tar.gz && \
wget https://github.com/shadowsocks/shadowsocks-rust/archive/refs/tags/v${SS_RUST}.tar.gz && tar xf v${SS_RUST}.tar.gz tar xf v${SS_RUST}.tar.gz && /apk/setup
WORKDIR ./shadowsocks-rust-${SS_RUST}/ WORKDIR ./shadowsocks-rust-${SS_RUST}/
RUN cargo fetch RUN cargo fetch
RUN cargo build --target-dir ./ --release --bin sslocal --bin ssserver \ RUN cargo build --target-dir ./ --release --bin sslocal --bin ssserver \
--features "stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra" && \ --features "stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra" && \
mv ./release/sslocal /tmp/ss-rust-local && mv ./release/ssserver /tmp/ss-rust-server && strip /tmp/ss-rust-* cd ./release/ && strip sslocal ssserver && mv sslocal ssserver /tmp/
COPY --from=upx /upx/ /usr/ COPY --from=upx /tmp/upx /usr/bin/
RUN ls /tmp/ss-rust-* | xargs -P0 -n1 upx -9 RUN ls /tmp/ss-rust-* | xargs -P0 -n1 upx -9
# Compile shadowsocks-libev # Compile shadowsocks-libev
@ -63,53 +64,56 @@ FROM ${ALPINE_IMG} AS ss-libev
ENV SS_LIBEV="3.3.5" ENV SS_LIBEV="3.3.5"
RUN apk add c-ares-dev libev-dev libsodium-dev linux-headers mbedtls-dev pcre-dev RUN apk add c-ares-dev libev-dev libsodium-dev linux-headers mbedtls-dev pcre-dev
COPY --from=build-base /apk/ /apk/ COPY --from=build-base /apk/ /apk/
RUN /apk/build-base && \ RUN wget https://github.com/shadowsocks/shadowsocks-libev/releases/download/v${SS_LIBEV}/shadowsocks-libev-${SS_LIBEV}.tar.gz && \
wget https://github.com/shadowsocks/shadowsocks-libev/releases/download/v${SS_LIBEV}/shadowsocks-libev-${SS_LIBEV}.tar.gz && tar xf shadowsocks-libev-*.tar.gz tar xf shadowsocks-libev-*.tar.gz && /apk/setup
WORKDIR ./shadowsocks-libev-${SS_LIBEV}/ WORKDIR ./shadowsocks-libev-${SS_LIBEV}/
RUN ./configure --disable-documentation && make && \ RUN ./configure --disable-documentation && \
mv ./src/ss-local /tmp/ss-libev-local && mv ./src/ss-server /tmp/ss-libev-server && strip /tmp/ss-libev-* make && cd ./src/ && strip ss-local ss-server && \
mv ss-local /tmp/ss-libev-local && mv ss-server /tmp/ss-libev-server
# Package shadowsocks-python (lastest version, legacy version, R version aka ssr) # Package shadowsocks-python (lastest version, legacy version, R version aka ssr)
FROM ${PYTHON_IMG} AS ss-python FROM ${PYTHON_IMG} AS ss-python
ENV SS_PYTHON_LEGACY="2.6.2" ENV SS_PYTHON="2.6.2"
RUN apk add git && mkdir /packages/ && \ RUN apk add git && mkdir -p /packages/
git clone https://github.com/dnomd343/shadowsocksr.git && \ RUN git clone https://github.com/dnomd343/shadowsocksr.git && \
git clone https://github.com/shadowsocks/shadowsocks.git && \ git clone https://github.com/shadowsocks/shadowsocks.git && \
wget https://github.com/shadowsocks/shadowsocks/archive/refs/tags/${SS_PYTHON_LEGACY}.tar.gz && tar xf ${SS_PYTHON_LEGACY}.tar.gz wget https://github.com/shadowsocks/shadowsocks/archive/refs/tags/${SS_PYTHON}.tar.gz && tar xf ${SS_PYTHON}.tar.gz
# shadowsocks-python (R version) # shadowsocks-python (R version)
WORKDIR ./shadowsocksr/ WORKDIR /shadowsocksr/
RUN sed -i 's/MutableMapping/abc.MutableMapping/' ./shadowsocks/lru_cache.py && \ RUN sed -i 's/MutableMapping/abc.MutableMapping/' ./shadowsocks/lru_cache.py && \
sed -i 's/MutableMapping/abc.MutableMapping/' ./shadowsocks/ordereddict.py && \ sed -i 's/MutableMapping/abc.MutableMapping/' ./shadowsocks/ordereddict.py && \
sed -i "s/find_library(p)/'libcrypto.so.1.0.0'/g" ./shadowsocks/crypto/ctypes_openssl.py && \ sed -i "s/find_library(p)/'libcrypto.so.1.0.0'/g" ./shadowsocks/crypto/ctypes_openssl.py && \
sed -i "/for path in paths:/a\ if 'libcrypto.so' in path:" ./shadowsocks/crypto/util.py && \ sed -i "/for path in paths:/a\ if 'libcrypto.so' in path:" ./shadowsocks/crypto/util.py && \
sed -i "/libcrypto.so/a\ path = 'libcrypto.so.1.0.0'" ./shadowsocks/crypto/util.py && \ sed -i "/libcrypto.so/a\ path = 'libcrypto.so.1.0.0'" ./shadowsocks/crypto/util.py && \
python3 setup.py build && cd ./build/lib/shadowsocks/ && chmod +x ./local.py ./server.py && \ python3 setup.py build
mv ./local.py ./server.py ../ && mv ../../lib/ /packages/ssr-python/ WORKDIR ./build/lib/shadowsocks/
RUN chmod +x local.py server.py && mv local.py server.py ../ && mv ../../lib/ /packages/ssr-python/
# shadowsocks-python (latest version) # shadowsocks-python (latest version)
WORKDIR ../shadowsocks/ WORKDIR /shadowsocks/
RUN git checkout master && \ RUN git checkout master && \
sed -i 's/if addr is/if addr ==/g' ./shadowsocks/common.py && \ sed -i 's/if addr is/if addr ==/g' ./shadowsocks/common.py && \
sed -i 's/and ip is not/and ip !=/g' ./shadowsocks/common.py && \ sed -i 's/and ip is not/and ip !=/g' ./shadowsocks/common.py && \
sed -i 's/if len(block) is/if len(block) ==/g' ./shadowsocks/common.py && \ sed -i 's/if len(block) is/if len(block) ==/g' ./shadowsocks/common.py && \
sed -i 's/MutableMapping/abc.MutableMapping/' ./shadowsocks/lru_cache.py && \ sed -i 's/MutableMapping/abc.MutableMapping/' ./shadowsocks/lru_cache.py && \
python3 setup.py build && cd ./build/lib/shadowsocks/ && chmod +x ./local.py ./server.py && \ python3 setup.py build
mv ./local.py ./server.py ../ && mv ../../lib/ /packages/ss-python/ WORKDIR ./build/lib/shadowsocks/
RUN chmod +x local.py server.py && mv local.py server.py ../ && mv ../../lib/ /packages/ss-python/
# shadowsocks-python (legacy version) # shadowsocks-python (legacy version)
WORKDIR ../shadowsocks-${SS_PYTHON_LEGACY}/ WORKDIR /shadowsocks-${SS_PYTHON}/
RUN sed -i 's/MutableMapping/abc.MutableMapping/' ./shadowsocks/lru_cache.py && \ RUN sed -i 's/MutableMapping/abc.MutableMapping/' ./shadowsocks/lru_cache.py && \
sed -i "s/find_library(p)/'libsodium.so.23'/g" ./shadowsocks/crypto/ctypes_libsodium.py && \ sed -i "s/find_library(p)/'libsodium.so.23'/g" ./shadowsocks/crypto/ctypes_libsodium.py && \
sed -i "s/find_library(p)/'libcrypto.so.1.0.0'/g" ./shadowsocks/crypto/ctypes_openssl.py && \ sed -i "s/find_library(p)/'libcrypto.so.1.0.0'/g" ./shadowsocks/crypto/ctypes_openssl.py && \
python3 setup.py build && cd ./build/lib/shadowsocks/ && chmod +x ./local.py ./server.py && \ python3 setup.py build
mv ./local.py ./server.py ../ && mv ../../lib/ /packages/ss-python-legacy/ WORKDIR ./build/lib/shadowsocks/
RUN chmod +x local.py server.py && mv local.py server.py ../ && mv ../../lib/ /packages/ss-python-legacy/
# Compile shadowsocks-bootstrap # Compile shadowsocks-bootstrap
FROM ${ALPINE_IMG} AS ss-bootstrap FROM ${ALPINE_IMG} AS ss-bootstrap
RUN apk add cmake git RUN apk add cmake git
COPY --from=build-base /apk/ /apk/ COPY --from=build-base /apk/ /apk/
RUN git clone https://github.com/dnomd343/shadowsocks-bootstrap.git && /apk/build-base RUN git clone https://github.com/dnomd343/shadowsocks-bootstrap.git && /apk/setup
WORKDIR ./shadowsocks-bootstrap/build/ WORKDIR ./shadowsocks-bootstrap/bin/
RUN cmake -DCMAKE_BUILD_TYPE=Release .. && make && \ RUN cmake -DCMAKE_BUILD_TYPE=Release .. && make && strip ss-bootstrap-* && mv ss-bootstrap-* /tmp/
mv ../bin/ss-bootstrap-* /tmp/ && strip /tmp/ss-bootstrap-*
# Combine shadowsocks dependencies # Combine shadowsocks dependencies
FROM ${PYTHON_IMG} AS shadowsocks FROM ${PYTHON_IMG} AS shadowsocks
@ -129,45 +133,46 @@ FROM ${ALPINE_IMG} AS python-pkg
COPY --from=wheels /wheels/*.whl /site-packages/ COPY --from=wheels /wheels/*.whl /site-packages/
COPY --from=ss-python /packages/ /site-packages/ COPY --from=ss-python /packages/ /site-packages/
WORKDIR /site-packages/ WORKDIR /site-packages/
RUN ls ./*.whl | xargs -n1 unzip && rm ./*.whl && \ RUN ls *.whl | xargs -n1 unzip && rm *.whl && \
rm -rf $(find ./ -name '__pycache__') && tar czf /packages.tar.gz ./ rm -rf $(find ./ -name '__pycache__') && tar czf /packages.tar.gz ./
# Compile openssl (old version, for shadowsocks method -> idea-cfb / seed-cfb) # Compile openssl (old version, for shadowsocks method -> idea-cfb / seed-cfb)
FROM ${ALPINE_IMG} AS openssl FROM ${ALPINE_IMG} AS openssl
ENV OPENSSL_VER="1.0.2" ENV OPENSSL="1.0.2"
ENV OPENSSL_SUB_VER="u" ENV OPENSSL_SUB="u"
COPY --from=build-base /apk/ /apk/ COPY --from=build-base /apk/ /apk/
RUN apk add perl && /apk/build-base && \ RUN apk add perl && wget https://www.openssl.org/source/old/${OPENSSL}/openssl-${OPENSSL}${OPENSSL_SUB}.tar.gz && \
wget https://www.openssl.org/source/old/${OPENSSL_VER}/openssl-${OPENSSL_VER}${OPENSSL_SUB_VER}.tar.gz && tar xf openssl-*.tar.gz tar xf openssl-*.tar.gz && /apk/setup
WORKDIR ./openssl-${OPENSSL_VER}${OPENSSL_SUB_VER}/ WORKDIR ./openssl-${OPENSSL}${OPENSSL_SUB}/
RUN ./config --shared --prefix=/usr && make && \ RUN ./config --shared --prefix=/usr && make && \
mv ./libcrypto.so.1.0.0 /tmp/ && strip /tmp/libcrypto.so.1.0.0 strip libcrypto.so.1.0.0 && mv libcrypto.so.1.0.0 /tmp/
# Compile sip003 plugins (part1 -> gcc & cargo) # Compile sip003 plugins (part1 -> gcc & cargo)
FROM ${RUST_IMG} AS plugin-1 FROM ${RUST_IMG} AS plugin-1
RUN apk add autoconf automake git libev-dev libtool linux-headers RUN apk add autoconf automake git libev-dev libtool linux-headers
COPY --from=build-base /apk/ /apk/ COPY --from=build-base /apk/ /apk/
RUN /apk/build-base && mkdir -p /plugins/ && \ RUN git clone https://github.com/shadowsocks/qtun.git && \
git clone https://github.com/shadowsocks/qtun.git && \ git clone https://github.com/shadowsocks/simple-obfs.git && \
git clone https://github.com/shadowsocks/simple-obfs.git /apk/setup && mkdir -p /plugins/
# Compile simple-obfs # Compile simple-obfs
WORKDIR ./simple-obfs/ WORKDIR /simple-obfs/
RUN git submodule update --init --recursive && ./autogen.sh && \ RUN git submodule update --init --recursive && ./autogen.sh && \
./configure --disable-documentation && make && mv ./src/obfs-local ./src/obfs-server /plugins/ ./configure --disable-documentation && make && cd ./src/ && \
strip obfs-local obfs-server && mv obfs-local obfs-server /plugins/
# Compile qtun # Compile qtun
WORKDIR ../qtun/ WORKDIR /qtun/
RUN cargo fetch RUN cargo fetch
RUN cargo build --target-dir ./ --release && \ RUN cargo build --target-dir ./ --release && cd ./release/ && \
mv ./release/qtun-client ./release/qtun-server /plugins/ && strip /plugins/* strip qtun-client qtun-server && mv qtun-client qtun-server /plugins/
COPY --from=upx /upx/ /usr/ COPY --from=upx /usr/upx /usr/bin/
RUN ls /plugins/qtun-* | xargs -P0 -n1 upx -9 RUN ls /plugins/qtun-* | xargs -P0 -n1 upx -9
# Compile sip003 plugins (part2 -> go1.16) # Compile sip003 plugins (part2 -> go1.16)
FROM ${GO16_IMG} AS plugin-2 FROM ${GO16_IMG} AS plugin-2
ENV GOST_PLUGIN="v1.6.3" ENV GOST_PLUGIN="v1.6.3"
RUN apk add git && mkdir /plugins/ ENV V2RAY_PLUGIN="v1.3.2"
RUN apk add git && mkdir -p /plugins/
RUN git clone https://github.com/Qv2ray/gun.git && \ RUN git clone https://github.com/Qv2ray/gun.git && \
git clone https://github.com/dnomd343/kcptun.git && \
git clone https://github.com/dnomd343/GoQuiet.git && \ git clone https://github.com/dnomd343/GoQuiet.git && \
git clone https://github.com/ihciah/rabbit-tcp.git && \ git clone https://github.com/ihciah/rabbit-tcp.git && \
git clone https://github.com/dnomd343/rabbit-plugin.git && \ git clone https://github.com/dnomd343/rabbit-plugin.git && \
@ -175,76 +180,76 @@ RUN git clone https://github.com/Qv2ray/gun.git && \
git clone https://github.com/shadowsocks/v2ray-plugin.git && \ git clone https://github.com/shadowsocks/v2ray-plugin.git && \
git clone https://github.com/IrineSistiana/mos-tls-tunnel.git git clone https://github.com/IrineSistiana/mos-tls-tunnel.git
# Compile v2ray-plugin # Compile v2ray-plugin
WORKDIR ./v2ray-plugin/ WORKDIR /go/v2ray-plugin/
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.VERSION=$(git describe --tags) -s -w" && mv ./v2ray-plugin /plugins/ RUN git checkout ${V2RAY_PLUGIN} && \
# Compile kcptun env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.VERSION=$(git describe --tags) -s -w" && \
WORKDIR ../kcptun/ mv v2ray-plugin /plugins/
RUN git checkout sip003 && \
go mod init github.com/shadowsocks/kcptun && go mod tidy
RUN env CGO_ENABLED=0 go build -v -o kcptun-client -trimpath -ldflags "-X main.VERSION=$(git describe --tags) -s -w" ./client && \
env CGO_ENABLED=0 go build -v -o kcptun-server -trimpath -ldflags "-X main.VERSION=$(git describe --tags) -s -w" ./server && \
mv ./kcptun-client ./kcptun-server /plugins/
# Compile gost-plugin # Compile gost-plugin
WORKDIR ../gost-plugin/ WORKDIR /go/gost-plugin/
RUN git checkout ${GOST_PLUGIN} && go mod download -x RUN git checkout ${GOST_PLUGIN} && \
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.VERSION=$(git describe --tags) -s -w" && mv ./gost-plugin /plugins/ env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.VERSION=$(git describe --tags) -s -w" && \
mv gost-plugin /plugins/
# Compile GoQuiet # Compile GoQuiet
WORKDIR ../GoQuiet/ WORKDIR /go/GoQuiet/
RUN go mod init github.com/cbeuw/GoQuiet RUN go mod init github.com/cbeuw/GoQuiet && go mod tidy
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.version=$(git describe --tags) -s -w" ./cmd/gq-client && \ RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.version=$(git describe --tags) -s -w" ./cmd/gq-client/ && \
env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.version=$(git describe --tags) -s -w" ./cmd/gq-server && \ env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.version=$(git describe --tags) -s -w" ./cmd/gq-server/ && \
mv ./gq-client ./gq-server /plugins/ mv gq-client gq-server /plugins/
# Compile mos-tls-tunnel # Compile mos-tls-tunnel
WORKDIR ../mos-tls-tunnel/ WORKDIR /go/mos-tls-tunnel/
RUN go mod init github.com/IrineSistiana/mos-tls-tunnel && go mod vendor RUN go mod init github.com/IrineSistiana/mos-tls-tunnel && go mod vendor
RUN env CGO_ENABLED=0 go build -v -mod=vendor -trimpath -ldflags "-s -w" ./cmd/mtt-client && \ RUN env CGO_ENABLED=0 go build -v -mod=vendor -trimpath -ldflags "-s -w" ./cmd/mtt-client/ && \
env CGO_ENABLED=0 go build -v -mod=vendor -trimpath -ldflags "-s -w" ./cmd/mtt-server && \ env CGO_ENABLED=0 go build -v -mod=vendor -trimpath -ldflags "-s -w" ./cmd/mtt-server/ && \
mv ./mtt-client ./mtt-server /plugins/ mv mtt-client mtt-server /plugins/
# Compile rabbit-plugin # Compile rabbit-plugin
WORKDIR ../rabbit-plugin/ WORKDIR /go/rabbit-plugin/
RUN go mod download -x RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv rabbit-plugin /plugins/
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv ./rabbit-plugin /plugins/
# Compile rabbit-tcp # Compile rabbit-tcp
WORKDIR ../rabbit-tcp/ WORKDIR /go/rabbit-tcp/cmd/
RUN go mod download -x RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.Version=$(git describe --tags) -s -w" && \
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.Version=$(git describe --tags) -s -w" ./cmd/rabbit.go && mv ./rabbit /plugins/ mv cmd /plugins/rabbit
# Compile gun-plugin # Compile gun-plugin
WORKDIR ../gun/ WORKDIR /go/gun/
RUN go mod download -x RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" ./cmd/sip003/ && mv sip003 /plugins/gun-plugin
RUN env CGO_ENABLED=0 go build -v -o gun-plugin -trimpath -ldflags "-s -w" ./cmd/sip003/ && mv ./gun-plugin /plugins/ COPY --from=upx /tmp/upx/ /usr/bin/
COPY --from=upx /upx/ /usr/
RUN ls /plugins/* | xargs -P0 -n1 upx -9 RUN ls /plugins/* | xargs -P0 -n1 upx -9
# Compile sip003 plugins (part3 -> go1.17) # Compile sip003 plugins (part3 -> go1.17)
FROM ${GO17_IMG} AS plugin-3 FROM ${GO17_IMG} AS plugin-3
ENV SIMPLE_TLS="v0.7.0" ENV SIMPLE_TLS="v0.7.0"
ENV CLOAK="v2.6.0" ENV CLOAK="v2.6.0"
RUN apk add git && mkdir /plugins/ RUN apk add git && mkdir -p /plugins/
RUN git clone https://github.com/cbeuw/Cloak.git && \ RUN git clone https://github.com/cbeuw/Cloak.git && \
git clone https://github.com/IrineSistiana/simple-tls.git git clone https://github.com/IrineSistiana/simple-tls.git
# Compile simple-tls # Compile simple-tls
WORKDIR ./simple-tls/ WORKDIR /go/simple-tls/
RUN git checkout ${SIMPLE_TLS} && go mod download -x RUN git checkout ${SIMPLE_TLS} && \
RUN sed -i 's/version = "unknown\/dev"/version = "'$(git describe --tags)'"/g' main.go && \ sed -i 's/version = "unknown\/dev"/version = "'$(git describe --tags)'"/g' main.go && \
env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv ./simple-tls /plugins/ env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv simple-tls /plugins/
# Compile Cloak # Compile Cloak
WORKDIR ../Cloak/ WORKDIR /go/Cloak/
RUN git checkout ${CLOAK} && go mod download -x RUN git checkout ${CLOAK} && \
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.version=$(git describe --tags) -s -w" ./cmd/ck-client && \ env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.version=$(git describe --tags) -s -w" ./cmd/ck-client/ && \
env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.version=$(git describe --tags) -s -w" ./cmd/ck-server && \ env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.version=$(git describe --tags) -s -w" ./cmd/ck-server/ && \
mv ./ck-client ./ck-server /plugins/ mv ck-client ck-server /plugins/
COPY --from=upx /upx/ /usr/ COPY --from=upx /tmp/upx /usr/bin/
RUN ls /plugins/* | xargs -P0 -n1 upx -9 RUN ls /plugins/* | xargs -P0 -n1 upx -9
# Compile sip003 plugins (part4 -> go1.18) # Compile sip003 plugins (part4 -> go1.18)
FROM ${GO18_IMG} AS plugin-4 FROM ${GO18_IMG} AS plugin-4
RUN apk add git && mkdir /plugins/ RUN apk add git && mkdir -p /plugins/
RUN git clone https://github.com/teddysun/xray-plugin.git RUN git clone https://github.com/dnomd343/kcptun.git && \
git clone https://github.com/teddysun/xray-plugin.git
# Compile xray-plugin # Compile xray-plugin
WORKDIR ./xray-plugin/ WORKDIR /go/xray-plugin/
RUN go mod download -x RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.VERSION=$(git describe --tags) -s -w" && mv xray-plugin /plugins/
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.VERSION=$(git describe --tags) -s -w" && mv ./xray-plugin /plugins/ # Compile kcptun
COPY --from=upx /upx/ /usr/ WORKDIR /go/kcptun/
RUN git checkout sip003 && go mod init github.com/shadowsocks/kcptun && go mod tidy
RUN env CGO_ENABLED=0 go build -v -o kcptun-client -trimpath -ldflags "-X main.VERSION=$(git describe --tags) -s -w" ./client/ && \
env CGO_ENABLED=0 go build -v -o kcptun-server -trimpath -ldflags "-X main.VERSION=$(git describe --tags) -s -w" ./server/ && \
mv kcptun-client kcptun-server /plugins/
COPY --from=upx /tmp/upx /usr/bin/
RUN ls /plugins/* | xargs -P0 -n1 upx -9 RUN ls /plugins/* | xargs -P0 -n1 upx -9
# Combine sip003 plugins # Combine sip003 plugins
@ -255,105 +260,95 @@ COPY --from=plugin-3 /plugins/ /plugins/
COPY --from=plugin-4 /plugins/ /plugins/ COPY --from=plugin-4 /plugins/ /plugins/
# Compile xray-core # Compile xray-core
FROM golang:1.18-alpine3.16 AS xray FROM ${GO19_IMG} AS xray
ENV XRAY_VERSION="1.5.10" ENV XRAY="1.6.0"
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}.tar.gz && tar xf v${XRAY}.tar.gz
WORKDIR ./Xray-core-${XRAY_VERSION}/ WORKDIR ./Xray-core-${XRAY}/main/
RUN go mod download -x RUN go get -d
RUN env CGO_ENABLED=0 go build -v -o xray -trimpath -ldflags "-s -w" ./main/ && mv ./xray /tmp/ RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv main /tmp/xray
COPY --from=upx /upx/ /usr/ COPY --from=upx /tmp/upx /usr/bin/
RUN upx -9 /tmp/xray RUN upx -9 /tmp/xray
# Compile v2ray-core # Compile v2ray-core
FROM golang:1.18-alpine3.16 AS v2ray FROM ${GO19_IMG} AS v2ray
ENV V2FLY_VERSION="4.45.2" ENV V2FLY="5.1.0"
RUN wget https://github.com/v2fly/v2ray-core/archive/refs/tags/v${V2FLY_VERSION}.tar.gz && tar xf v${V2FLY_VERSION}.tar.gz RUN wget https://github.com/v2fly/v2ray-core/archive/refs/tags/v${V2FLY}.tar.gz && tar xf v${V2FLY}.tar.gz
WORKDIR ./v2ray-core-${V2FLY_VERSION}/ WORKDIR ./v2ray-core-${V2FLY}/main/
RUN go mod download -x RUN go get -d
RUN env CGO_ENABLED=0 go build -v -o v2ray -trimpath -ldflags "-s -w" ./main/ && mv ./v2ray /tmp/ RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv main /tmp/v2ray
COPY --from=upx /upx/ /usr/ COPY --from=upx /tmp/upx /usr/bin/
RUN upx -9 /tmp/v2ray RUN upx -9 /tmp/v2ray
# Compile v2ray-core (Sagernet version)
FROM golang:1.18-alpine3.16 AS sagray
ENV SAGER_VERSION="5.0.16"
RUN wget https://github.com/SagerNet/v2ray-core/archive/refs/tags/v${SAGER_VERSION}.tar.gz && tar xf v${SAGER_VERSION}.tar.gz
WORKDIR ./v2ray-core-${SAGER_VERSION}/
RUN go mod download -x
RUN env CGO_ENABLED=0 go build -v -o sagray -trimpath -ldflags "-s -w" ./main/ && mv ./sagray /tmp/
COPY --from=upx /upx/ /usr/
RUN upx -9 /tmp/sagray
# Compile trojan-go # Compile trojan-go
FROM ${GO17_IMG} AS trojan-go FROM ${GO17_IMG} AS trojan-go
ENV TROJAN_GO_VERSION="v0.10.6" ENV TROJAN_GO="v0.10.6"
RUN apk add git && git clone https://github.com/p4gefau1t/trojan-go.git RUN apk add git && git clone https://github.com/p4gefau1t/trojan-go.git
WORKDIR ./trojan-go/ WORKDIR ./trojan-go/
RUN git checkout ${TROJAN_GO_VERSION} && go mod download -x RUN git checkout ${TROJAN_GO} && go get -d
RUN env CGO_ENABLED=0 go build -v -tags "full" -trimpath -ldflags " \ RUN env CGO_ENABLED=0 go build -v -tags "full" -trimpath -ldflags " \
-X github.com/p4gefau1t/trojan-go/constant.Version=$(git describe --dirty) \ -X github.com/p4gefau1t/trojan-go/constant.Version=$(git describe --dirty) \
-X github.com/p4gefau1t/trojan-go/constant.Commit=$(git rev-parse HEAD) -s -w" && \ -X github.com/p4gefau1t/trojan-go/constant.Commit=$(git rev-parse HEAD) -s -w" && \
mv ./trojan-go /tmp/ mv trojan-go /tmp/
COPY --from=upx /upx/ /usr/ COPY --from=upx /tmp/upx /usr/bin/
RUN upx -9 /tmp/trojan-go RUN upx -9 /tmp/trojan-go
# Compile trojan # Compile trojan
FROM ${ALPINE_IMG} AS trojan FROM ${ALPINE_IMG} AS trojan
ENV TROJAN_VERSION="1.16.0" ENV TROJAN="1.16.0"
RUN apk add boost-dev cmake openssl-dev RUN apk add boost-dev cmake openssl-dev
COPY --from=build-base /apk/ /apk/ COPY --from=build-base /apk/ /apk/
RUN /apk/build-base && \ RUN wget https://github.com/trojan-gfw/trojan/archive/refs/tags/v${TROJAN}.tar.gz && \
wget https://github.com/trojan-gfw/trojan/archive/refs/tags/v${TROJAN_VERSION}.tar.gz && tar xf v${TROJAN_VERSION}.tar.gz tar xf v${TROJAN}.tar.gz && /apk/setup
WORKDIR ./trojan-${TROJAN_VERSION}/build/ WORKDIR ./trojan-${TROJAN}/build/
RUN cmake .. -DENABLE_MYSQL=OFF -DSYSTEMD_SERVICE=OFF && make && mv ./trojan /tmp/ && strip /tmp/trojan RUN cmake .. -DENABLE_MYSQL=OFF -DSYSTEMD_SERVICE=OFF && make && strip trojan && mv trojan /tmp/
COPY --from=trojan-go /tmp/trojan-go /tmp/ COPY --from=trojan-go /tmp/trojan-go /tmp/
# Compile gost and gost-v3 # Compile gost and gost-v3
FROM ${GO19_IMG} AS gost FROM ${GO19_IMG} AS gost
ENV GOST_VERSION="2.11.3" ENV GOST="2.11.4"
ENV GOST_V3_VERSION="3.0.0-beta.4" ENV GOST_V3="3.0.0-beta.5"
RUN apk add git RUN apk add git
RUN wget https://github.com/ginuerzh/gost/archive/refs/tags/v${GOST_VERSION}.tar.gz && tar xf v${GOST_VERSION}.tar.gz && \ RUN wget https://github.com/ginuerzh/gost/archive/refs/tags/v${GOST}.tar.gz && tar xf v${GOST}.tar.gz && \
wget https://github.com/go-gost/gost/archive/refs/tags/v${GOST_V3_VERSION}.tar.gz && tar xf v${GOST_V3_VERSION}.tar.gz wget https://github.com/go-gost/gost/archive/refs/tags/v${GOST_V3}.tar.gz && tar xf v${GOST_V3}.tar.gz
WORKDIR ./gost-${GOST_VERSION}/ WORKDIR /go/gost-${GOST}/cmd/gost/
RUN go mod download -x RUN go get -d
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" ./cmd/gost && mv ./gost /tmp/ RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv gost /tmp/
WORKDIR ../gost-${GOST_V3_VERSION}/ WORKDIR /go/gost-${GOST_V3}/cmd/gost/
RUN go mod download -x RUN go get -d
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" ./cmd/gost && mv ./gost /tmp/gost-v3 RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv gost /tmp/gost-v3
COPY --from=upx /upx/ /usr/ COPY --from=upx /tmp/upx /usr/bin/
RUN ls /tmp/gost* | xargs -P0 -n1 upx -9 RUN ls /tmp/gost* | xargs -P0 -n1 upx -9
# Compile brook # Compile brook
FROM ${GO16_IMG} AS brook FROM ${GO16_IMG} AS brook
ENV BROOK_VERSION="20220707" ENV BROOK="20221010"
RUN wget https://github.com/txthinking/brook/archive/refs/tags/v${BROOK_VERSION}.tar.gz && tar xf v${BROOK_VERSION}.tar.gz RUN wget https://github.com/txthinking/brook/archive/refs/tags/v${BROOK}.tar.gz && tar xf v${BROOK}.tar.gz
WORKDIR ./brook-${BROOK_VERSION}/ WORKDIR ./brook-${BROOK}/cli/brook/
RUN go mod download -x RUN go mod download -x
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" ./cli/brook && mv ./brook /tmp/ RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w" && mv brook /tmp/
COPY --from=upx /upx/ /usr/ COPY --from=upx /tmp/upx /usr/bin/
RUN upx -9 /tmp/brook RUN upx -9 /tmp/brook
# Compile clash # Compile clash
FROM ${GO19_IMG} AS clash FROM ${GO19_IMG} AS clash
ENV CLASH_VERSION="1.11.8" ENV CLASH="1.11.8"
RUN wget https://github.com/Dreamacro/clash/archive/refs/tags/v${CLASH_VERSION}.tar.gz && tar xf v${CLASH_VERSION}.tar.gz RUN wget https://github.com/Dreamacro/clash/archive/refs/tags/v${CLASH}.tar.gz && tar xf v${CLASH}.tar.gz
WORKDIR ./clash-${CLASH_VERSION}/ WORKDIR ./clash-${CLASH}/
RUN go mod download -x RUN go mod download -x
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w \ RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w \
-X 'github.com/Dreamacro/clash/constant.Version=${CLASH_VERSION}' \ -X 'github.com/Dreamacro/clash/constant.Version=${CLASH}' \
-X 'github.com/Dreamacro/clash/constant.BuildTime=$(date -u)'" && \ -X 'github.com/Dreamacro/clash/constant.BuildTime=$(date -u)'" && \
mv ./clash /tmp/ mv clash /tmp/
COPY --from=upx /upx/ /usr/ COPY --from=upx /tmp/upx /usr/bin/
RUN upx -9 /tmp/clash RUN upx -9 /tmp/clash
# Download naiveproxy # Download naiveproxy
FROM ${ALPINE_IMG} AS naive FROM ${ALPINE_IMG} AS naive
ENV NAIVE_VERSION="v105.0.5195.52-1" ENV NAIVE="v106.0.5249.91-1"
COPY --from=build-base /apk/ /apk/ COPY --from=build-base /apk/ /apk/
RUN apk add curl libgcc jq && /apk/build-base RUN apk add curl libgcc jq && /apk/setup
RUN curl -sL https://api.github.com/repos/klzgrad/naiveproxy/releases/tags/${NAIVE_VERSION} \ RUN curl -sL https://api.github.com/repos/klzgrad/naiveproxy/releases/tags/${NAIVE} \
| jq .assets | jq .[].name | grep naiveproxy-${NAIVE_VERSION}-openwrt-$(uname -m) \ | jq .assets | jq .[].name | grep naiveproxy-${NAIVE}-openwrt-$(uname -m) \
| cut -b 2- | rev | cut -b 2- | rev | tac > list.dat | cut -b 2- | rev | cut -b 2- | rev | tac > list.dat
RUN echo "while read FILE_NAME; do" >> naive.sh && \ RUN echo "while read FILE_NAME; do" >> naive.sh && \
echo "wget https://github.com/klzgrad/naiveproxy/releases/download/\${NAIVE_VERSION}/\${FILE_NAME}" >> naive.sh && \ echo "wget https://github.com/klzgrad/naiveproxy/releases/download/\${NAIVE_VERSION}/\${FILE_NAME}" >> naive.sh && \
@ -363,92 +358,90 @@ RUN echo "while read FILE_NAME; do" >> naive.sh && \
# Compile open-snell # Compile open-snell
FROM ${GO17_IMG} AS snell FROM ${GO17_IMG} AS snell
ENV SNELL_VERSION="3.0.1" ENV SNELL="3.0.1"
RUN wget https://github.com/icpz/open-snell/archive/refs/tags/v${SNELL_VERSION}.tar.gz && tar xf v${SNELL_VERSION}.tar.gz RUN wget https://github.com/icpz/open-snell/archive/refs/tags/v${SNELL}.tar.gz && tar xf v${SNELL}.tar.gz
WORKDIR ./open-snell-${SNELL_VERSION}/ WORKDIR ./open-snell-${SNELL}/
RUN go mod download -x RUN go get -d
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags \ RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags \
"-s -w -X 'github.com/icpz/open-snell/constants.Version=${SNELL_VERSION}'" ./cmd/snell-client && \ "-s -w -X 'github.com/icpz/open-snell/constants.Version=${SNELL}'" ./cmd/snell-client/ && \
env CGO_ENABLED=0 go build -v -trimpath -ldflags \ env CGO_ENABLED=0 go build -v -trimpath -ldflags \
"-s -w -X 'github.com/icpz/open-snell/constants.Version=${SNELL_VERSION}'" ./cmd/snell-server && \ "-s -w -X 'github.com/icpz/open-snell/constants.Version=${SNELL}'" ./cmd/snell-server/ && \
mv ./snell-client ./snell-server /tmp/ mv snell-client snell-server /tmp/
COPY --from=upx /upx/ /usr/ COPY --from=upx /tmp/upx /usr/bin/
RUN ls /tmp/snell-* | xargs -P0 -n1 upx -9 RUN ls /tmp/snell-* | xargs -P0 -n1 upx -9
# Compile hysteria # Compile hysteria
FROM ${GO19_IMG} AS hysteria FROM ${GO19_IMG} AS hysteria
ENV HYSTERIA_VERSION="v1.2.0" ENV HYSTERIA="v1.2.1"
RUN apk add git RUN apk add git
RUN git clone https://github.com/HyNetwork/hysteria.git RUN git clone https://github.com/HyNetwork/hysteria.git
WORKDIR ./hysteria/ WORKDIR ./hysteria/cmd/
RUN git checkout ${HYSTERIA_VERSION} && go mod download -x RUN git checkout ${HYSTERIA} && go get -d
RUN env CGO_ENABLED=0 go build -v -o hysteria -trimpath -ldflags "-s -w \ RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-s -w \
-X 'main.appVersion=$(git describe --tags)' \ -X 'main.appVersion=$(git describe --tags)' \
-X 'main.appCommit=$(git rev-parse HEAD)' \ -X 'main.appCommit=$(git rev-parse HEAD)' \
-X 'main.appDate=$(date "+%F %T")'" ./cmd && \ -X 'main.appDate=$(date "+%F %T")'" && \
mv ./hysteria /tmp/ mv cmd /tmp/hysteria
COPY --from=upx /upx/ /usr/ COPY --from=upx /tmp/upx /usr/bin/
RUN upx -9 /tmp/hysteria RUN upx -9 /tmp/hysteria
# Compile relaybaton # Compile relaybaton
FROM ${GO14_IMG} AS relaybaton FROM ${GO14_IMG} AS relaybaton
ENV RELAYBATON_VERSION="0.6.0" ENV RELAYBATON="0.6.0"
RUN apk add build-base git perl rsync RUN apk add build-base git perl rsync
RUN wget https://github.com/iyouport-org/relaybaton/archive/refs/tags/v${RELAYBATON_VERSION}.tar.gz && tar xf v${RELAYBATON_VERSION}.tar.gz RUN wget https://github.com/iyouport-org/relaybaton/archive/refs/tags/v${RELAYBATON}.tar.gz && tar xf v${RELAYBATON}.tar.gz
WORKDIR ./relaybaton-${RELAYBATON_VERSION}/ WORKDIR ./relaybaton-${RELAYBATON}/
RUN go mod download -x RUN go get -d
RUN make && mv ./bin/relaybaton /tmp/ RUN make && mv ./bin/relaybaton /tmp/
COPY --from=upx /upx/ /usr/ COPY --from=upx /upx/ /usr/
RUN upx -9 /tmp/relaybaton RUN upx -9 /tmp/relaybaton
# Compile dnsproxy # Compile dnsproxy
FROM ${GO18_IMG} AS dnsproxy FROM ${GO18_IMG} AS dnsproxy
ENV DNSPROXY_VERSION="0.44.0" ENV DNSPROXY="0.45.2"
RUN wget https://github.com/AdguardTeam/dnsproxy/archive/refs/tags/v${DNSPROXY_VERSION}.tar.gz && tar xf v${DNSPROXY_VERSION}.tar.gz RUN wget https://github.com/AdguardTeam/dnsproxy/archive/refs/tags/v${DNSPROXY}.tar.gz && tar xf v${DNSPROXY}.tar.gz
WORKDIR ./dnsproxy-${DNSPROXY_VERSION}/ WORKDIR ./dnsproxy-${DNSPROXY}/
RUN go mod download -x RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.VersionString=${DNSPROXY} -s -w" && mv dnsproxy /tmp/
RUN env CGO_ENABLED=0 go build -v -trimpath -ldflags "-X main.VersionString=${DNSPROXY_VERSION} -s -w" && mv ./dnsproxy /tmp/ COPY --from=upx /tmp/upx /usr/bin/
COPY --from=upx /upx/ /usr/
RUN upx -9 /tmp/dnsproxy RUN upx -9 /tmp/dnsproxy
# Compile mad # Compile mad
FROM ${GO16_IMG} AS mad FROM ${GO16_IMG} AS mad
ENV MAD_VERSION="20210401" ENV MAD="20210401"
RUN wget https://github.com/txthinking/mad/archive/refs/tags/v${MAD_VERSION}.tar.gz && tar xf v${MAD_VERSION}.tar.gz RUN wget https://github.com/txthinking/mad/archive/refs/tags/v${MAD}.tar.gz && tar xf v${MAD}.tar.gz
WORKDIR ./mad-${MAD_VERSION}/ WORKDIR ./mad-${MAD}/cli/mad/
RUN go mod download -x RUN go get -d
RUN env CGO_ENABLED=0 go build -v -ldflags="-s -w" ./cli/mad && mv ./mad /tmp/ RUN env CGO_ENABLED=0 go build -v -ldflags="-s -w" && mv mad /tmp/
COPY --from=upx /upx/ /usr/ COPY --from=upx /tmp/upx /usr/bin/
RUN upx -9 /tmp/mad RUN upx -9 /tmp/mad
# Combine all release # Combine all release
FROM ${PYTHON_IMG} AS asset FROM ${PYTHON_IMG} AS build
COPY --from=python-pkg /packages.tar.gz / COPY --from=python-pkg /packages.tar.gz /
ARG PYTHON="3.10" ARG PYTHON="3.10"
RUN mkdir -p /asset/usr/local/lib/python${PYTHON}/site-packages/ && \ WORKDIR /release/usr/local/lib/python${PYTHON}/site-packages/
tar xf /packages.tar.gz -C /asset/usr/local/lib/python${PYTHON}/site-packages/ RUN tar xf /packages.tar.gz -C ./
COPY --from=openssl /tmp/libcrypto.so* /asset/lib/ COPY --from=openssl /tmp/libcrypto.so* /release/lib/
COPY --from=shadowsocks /release/ /asset/usr/bin/ COPY --from=shadowsocks /release/ /release/usr/bin/
COPY --from=plugin /plugins/ /asset/usr/bin/ COPY --from=plugin /plugins/ /release/usr/bin/
COPY --from=xray /tmp/xray /asset/usr/bin/ COPY --from=xray /tmp/xray /release/usr/bin/
COPY --from=v2ray /tmp/v2ray /asset/usr/bin/ COPY --from=v2ray /tmp/v2ray /release/usr/bin/
COPY --from=sagray /tmp/sagray /asset/usr/bin/ COPY --from=trojan /tmp/trojan* /release/usr/bin/
COPY --from=trojan /tmp/trojan* /asset/usr/bin/ COPY --from=gost /tmp/gost* /release/usr/bin/
COPY --from=gost /tmp/gost* /asset/usr/bin/ COPY --from=brook /tmp/brook /release/usr/bin/
COPY --from=brook /tmp/brook /asset/usr/bin/ COPY --from=clash /tmp/clash /release/usr/bin/
COPY --from=clash /tmp/clash /asset/usr/bin/ COPY --from=naive /tmp/naive /release/usr/bin/
COPY --from=naive /tmp/naive /asset/usr/bin/ COPY --from=snell /tmp/snell-* /release/usr/bin/
COPY --from=snell /tmp/snell-* /asset/usr/bin/ COPY --from=hysteria /tmp/hysteria /release/usr/bin/
COPY --from=hysteria /tmp/hysteria /asset/usr/bin/ COPY --from=relaybaton /tmp/relaybaton /release/usr/bin/
COPY --from=relaybaton /tmp/relaybaton /asset/usr/bin/ COPY --from=dnsproxy /tmp/dnsproxy /release/usr/bin/
COPY --from=dnsproxy /tmp/dnsproxy /asset/usr/bin/ COPY --from=mad /tmp/mad /release/usr/bin/
COPY --from=mad /tmp/mad /asset/usr/bin/ COPY . /release/usr/local/share/ProxyC/
COPY . /asset/usr/local/share/ProxyC/
# Release docker image # Release docker image
FROM ${PYTHON_IMG} FROM ${PYTHON_IMG}
RUN apk add --no-cache boost-program_options c-ares ca-certificates libev libsodium libstdc++ mbedtls pcre && \ RUN apk add --no-cache boost-program_options c-ares ca-certificates libev libsodium libstdc++ mbedtls pcre && \
ln -s /usr/local/share/ProxyC/Main.py /usr/bin/proxyc ln -s /usr/local/share/ProxyC/Main.py /usr/bin/proxyc
COPY --from=asset /asset / COPY --from=build /release/ /
EXPOSE 7839 EXPOSE 7839
ENTRYPOINT ["proxyc"] ENTRYPOINT ["proxyc"]

Loading…
Cancel
Save