forked from docker-easyconnect/docker-easyconnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.cli
62 lines (48 loc) · 2.82 KB
/
Dockerfile.cli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM debian:bookworm-slim
ARG ANDROID_PATCH BUILD_ENV=local MIRROR_URL=http://ftp.cn.debian.org/debian/ EC_HOST
COPY ["./build-scripts/config-apt.sh", "./build-scripts/get-echost-names.sh", "./build-scripts/add-qemu.sh", \
"/tmp/build-scripts/"]
RUN . /tmp/build-scripts/config-apt.sh && \
. /tmp/build-scripts/get-echost-names.sh && \
. /tmp/build-scripts/add-qemu.sh && \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests iptables \
dante-server busybox iproute2 tinyproxy-bin ca-certificates ${qemu_pkgs} socat && \
for command in ps kill killall; do ln -s "$(which busybox)" /usr/local/bin/"${command}" || exit 1 ; done && \
rm -rf /var/lib/apt/lists/*
RUN groupadd -r socks && useradd -r -g socks socks
ARG EC_CLI_URL="https://github.com/shmilee/scripts/releases/download/v0.0.1/easyconn_7.6.8.2-ubuntu_amd64.deb"
COPY ./build-scripts/mk-qemu-wrapper.sh /tmp/build-scripts/
RUN EC_DIR=/usr/share/sangfor/EasyConnect/resources && cd /tmp && \
busybox wget "${EC_CLI_URL}" -O easyconn.deb && \
dpkg -x easyconn.deb easyconn && \
bash -c "mkdir -p ${EC_DIR}/{bin,lib64,shell,logs}/" && \
bash -c "cp easyconn/${EC_DIR}/bin/{CSClient,easyconn,ECAgent,svpnservice,ca.crt,cert.crt} \
/${EC_DIR}/bin/" && \
bash -c "chmod +xs ${EC_DIR}/bin/{CSClient,ECAgent,svpnservice}" && \
extra_bins=easyconn . /tmp/build-scripts/mk-qemu-wrapper.sh && \
bash -c "cp easyconn/${EC_DIR}/lib64/lib{nspr4,nss3,nssutil3,plc4,plds4,smime3}.so \
/${EC_DIR}/lib64/" && \
cp easyconn/${EC_DIR}/shell/* \
/${EC_DIR}/shell/ && \
chmod +x ${EC_DIR}/shell/* && \
ln -s ${EC_DIR}/bin/easyconn /usr/local/bin/ && \
cp -r easyconn/${EC_DIR}/conf ${EC_DIR}/conf_7.6.8 && rm -r * && echo "EC_CLI" > /etc/vpn-type
ARG EC_763_URL="http://download.sangfor.com.cn/download/product/sslvpn/pkg/linux_01/EasyConnect_x64.deb"
ARG EC_767_URL="http://download.sangfor.com.cn/download/product/sslvpn/pkg/linux_767/EasyConnect_x64_7_6_7_3.deb"
RUN cd /tmp && \
for ver in 7.6.3 7.6.7 ; do { \
vername=EC_$( echo "$ver" | sed 's/\.//g' )_URL && \
url="$(eval printf %s \"\$$vername\")" && \
if [ -n "${url}" ]; then busybox wget "${url}" -O EasyConnect.deb && dpkg -x EasyConnect.deb ec && \
cp -r ec/usr/share/sangfor/EasyConnect/resources/conf \
/usr/share/sangfor/EasyConnect/resources/conf_$ver && \
rm -r *; fi ;} || exit 1 ; done
RUN for i in /usr/share/sangfor/EasyConnect/resources/conf_*/; do \
ln -s /root/.easyconn $i/.easyconn ; \
done && touch /root/.easyconn
COPY ./docker-root /
COPY --from=hagb/docker-easyconnect:build /results/fake-hwaddr/ /results/tinyproxy-ws/ /
ENV PING_INTERVAL=1800
VOLUME /root/ /usr/share/sangfor/EasyConnect/resources/logs/
CMD start.sh