|
@ -9,6 +9,7 @@ ENV XRAY_VERSION="v1.5.3" |
|
|
ENV V2FLY_VERSION="v4.44.0" |
|
|
ENV V2FLY_VERSION="v4.44.0" |
|
|
|
|
|
|
|
|
ENV GO_VERSION="1.17.6" |
|
|
ENV GO_VERSION="1.17.6" |
|
|
|
|
|
ENV DNSPROXY_VERSION="v0.41.1" |
|
|
|
|
|
|
|
|
RUN \ |
|
|
RUN \ |
|
|
apk add asciidoc autoconf automake build-base curl c-ares-dev cmake \ |
|
|
apk add asciidoc autoconf automake build-base curl c-ares-dev cmake \ |
|
@ -44,9 +45,10 @@ git clone https://github.com/ihciah/rabbit-tcp.git && \ |
|
|
git clone https://github.com/shadowsocks/qtun.git && \ |
|
|
git clone https://github.com/shadowsocks/qtun.git && \ |
|
|
git clone https://github.com/Qv2ray/gun.git && \ |
|
|
git clone https://github.com/Qv2ray/gun.git && \ |
|
|
\ |
|
|
\ |
|
|
# Get source code of Xray-core and v2fly-core |
|
|
# Get source code |
|
|
git clone https://github.com/XTLS/Xray-core && \ |
|
|
git clone https://github.com/XTLS/Xray-core && \ |
|
|
git clone https://github.com/v2fly/v2ray-core && \ |
|
|
git clone https://github.com/v2fly/v2ray-core && \ |
|
|
|
|
|
git clone https://github.com/AdguardTeam/dnsproxy && \ |
|
|
\ |
|
|
\ |
|
|
# Install rust environment (nightly version) |
|
|
# Install rust environment (nightly version) |
|
|
sh -c "$(curl -sL https://sh.rustup.rs)" @ -y --no-modify-path --default-toolchain nightly && \ |
|
|
sh -c "$(curl -sL https://sh.rustup.rs)" @ -y --no-modify-path --default-toolchain nightly && \ |
|
@ -192,6 +194,12 @@ env CGO_ENABLED=0 go build -o v2ray -trimpath -ldflags "-s -w" ./main && \ |
|
|
env CGO_ENABLED=0 go build -o v2ctl -trimpath -ldflags "-s -w" -tags confonly ./infra/control/main && \ |
|
|
env CGO_ENABLED=0 go build -o v2ctl -trimpath -ldflags "-s -w" -tags confonly ./infra/control/main && \ |
|
|
mv ./v2ctl ./v2ray /tmp/release/ && \ |
|
|
mv ./v2ctl ./v2ray /tmp/release/ && \ |
|
|
\ |
|
|
\ |
|
|
|
|
|
# Compile dnsproxy |
|
|
|
|
|
cd /tmp/dnsproxy/ && \ |
|
|
|
|
|
git checkout $DNSPROXY_VERSION && VERSION=`git describe --tags` && \ |
|
|
|
|
|
env CGO_ENABLED=0 go build -trimpath -ldflags "-X main.VersionString=$VERSION -s -w" && \ |
|
|
|
|
|
mv ./dnsproxy /tmp/release/ && \ |
|
|
|
|
|
\ |
|
|
# Switch to go 1.16.13 |
|
|
# Switch to go 1.16.13 |
|
|
export PATH=/usr/local/go-1.16.13/bin:$PATH && \ |
|
|
export PATH=/usr/local/go-1.16.13/bin:$PATH && \ |
|
|
\ |
|
|
\ |
|
@ -251,25 +259,25 @@ mv ./target/release/qtun-server /tmp/release/ |
|
|
FROM alpine:3.15 as asset |
|
|
FROM alpine:3.15 as asset |
|
|
COPY --from=build /tmp/release/ /tmp/release/ |
|
|
COPY --from=build /tmp/release/ /tmp/release/ |
|
|
RUN apk add gcc python3 upx && \ |
|
|
RUN apk add gcc python3 upx && \ |
|
|
cd /tmp/ && mkdir ./bin/ && mkdir ./lib/ && \ |
|
|
mkdir -p /tmp/asset/bin/ && mkdir -p /tmp/asset/lib/ && \ |
|
|
mv ./release/packages.tar.gz ./ && tar xf packages.tar.gz && \ |
|
|
mv /tmp/release/packages.tar.gz /tmp/ && \ |
|
|
|
|
|
cd /tmp/ && tar xf packages.tar.gz && \ |
|
|
mv /tmp/release/*.tar.bz2 /tmp/packages/ && \ |
|
|
mv /tmp/release/*.tar.bz2 /tmp/packages/ && \ |
|
|
mv /tmp/release/*.so* /tmp/lib/ && \ |
|
|
mv /tmp/release/*.so* /tmp/asset/lib/ && \ |
|
|
mv /tmp/release/* /tmp/bin && \ |
|
|
mv /tmp/release/* /tmp/asset/bin/ && \ |
|
|
cd /tmp/bin/ && strip * && upx -9 * && \ |
|
|
cd /tmp/asset/bin/ && strip * && upx -9 * && \ |
|
|
cd /tmp/lib/ && strip * && \ |
|
|
cd /tmp/asset/lib/ && strip * && \ |
|
|
cd /tmp/packages/ && \ |
|
|
cd /tmp/packages/ && \ |
|
|
tar xf ssr-python.tar.bz2 && rm -f ./ssr-python.tar.bz2 && \ |
|
|
tar xf ssr-python.tar.bz2 && rm -f ./ssr-python.tar.bz2 && \ |
|
|
tar xf ss-python.tar.bz2 && rm -f ./ss-python.tar.bz2 && \ |
|
|
tar xf ss-python.tar.bz2 && rm -f ./ss-python.tar.bz2 && \ |
|
|
tar xf ss-python-legacy.tar.bz2 && rm -f ./ss-python-legacy.tar.bz2 && \ |
|
|
tar xf ss-python-legacy.tar.bz2 && rm -f ./ss-python-legacy.tar.bz2 && \ |
|
|
PYTHON_DIR=`ls /usr/lib/ | grep ^python` && \ |
|
|
PYTHON_DIR=`ls /usr/lib/ | grep ^python` && \ |
|
|
mkdir -p /tmp/lib/$PYTHON_DIR/ && \ |
|
|
mkdir -p /tmp/asset/lib/$PYTHON_DIR/ && \ |
|
|
mv /tmp/packages/ /tmp/lib/$PYTHON_DIR/site-packages/ |
|
|
mv /tmp/packages/ /tmp/asset/lib/$PYTHON_DIR/site-packages/ |
|
|
|
|
|
|
|
|
FROM alpine:3.15 |
|
|
FROM alpine:3.15 |
|
|
COPY . /usr/local/share/ProxyC |
|
|
COPY . /usr/local/share/ProxyC |
|
|
COPY --from=asset /tmp/bin/ /usr/bin/ |
|
|
COPY --from=asset /tmp/asset/ /usr/ |
|
|
COPY --from=asset /tmp/lib/ /usr/lib/ |
|
|
|
|
|
RUN apk add --no-cache c-ares ca-certificates glib \ |
|
|
RUN apk add --no-cache c-ares ca-certificates glib \ |
|
|
libev libsodium mbedtls pcre python3 redis udns && \ |
|
|
libev libsodium mbedtls pcre python3 redis udns && \ |
|
|
echo "daemonize yes" >> /etc/redis.conf && \ |
|
|
echo "daemonize yes" >> /etc/redis.conf && \ |
|
@ -281,5 +289,7 @@ ln -s $PKG_DIR/ss-python/local.py /usr/bin/ss-python-local && \ |
|
|
ln -s $PKG_DIR/ss-python/server.py /usr/bin/ss-python-server && \ |
|
|
ln -s $PKG_DIR/ss-python/server.py /usr/bin/ss-python-server && \ |
|
|
ln -s $PKG_DIR/ss-python-legacy/local.py /usr/bin/ss-python-legacy-local && \ |
|
|
ln -s $PKG_DIR/ss-python-legacy/local.py /usr/bin/ss-python-legacy-local && \ |
|
|
ln -s $PKG_DIR/ss-python-legacy/server.py /usr/bin/ss-python-legacy-server && \ |
|
|
ln -s $PKG_DIR/ss-python-legacy/server.py /usr/bin/ss-python-legacy-server && \ |
|
|
ln -s /usr/bin/python3 /usr/bin/python |
|
|
ln -s /usr/bin/python3 /usr/bin/python && \ |
|
|
|
|
|
cp /usr/local/share/ProxyC/docker/init.sh /usr/bin/ |
|
|
EXPOSE 43581 |
|
|
EXPOSE 43581 |
|
|
|
|
|
CMD ["sh","/usr/bin/init.sh"] |