Initial commit
This commit is contained in:
commit
32b0a9574f
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
#
|
||||
# Dockerfile for openconnect-arm
|
||||
#
|
||||
|
||||
FROM arm32v7/alpine:latest
|
||||
|
||||
RUN set -xe \
|
||||
&& apk add --no-cache nettle \
|
||||
&& apk add --no-cache \
|
||||
--repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ \
|
||||
openconnect \
|
||||
&& mkdir -p /etc/openconnect \
|
||||
&& touch /etc/openconnect/openconnect.conf
|
||||
|
||||
|
||||
COPY scripts/connect.sh /root
|
||||
RUN chmod +x /root/connect.sh
|
||||
|
||||
HEALTHCHECK --start-period=15s --retries=1 \
|
||||
CMD pgrep openconnect || exit 1; pgrep dnsmasq || exit 1
|
||||
|
||||
CMD ["sh" , "-c", "sh /root/connect.sh -D && ip addr && sh && tail -f /dev/null"]
|
||||
|
||||
6
scripts/connect.sh
Normal file
6
scripts/connect.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
echo ${ANYCONNECT_PASSWORD} |openconnect ${ANYCONNECT_SERVER} --user=${ANYCONNECT_USER} --authgroup=DEV ${ANYCONNECT_KEY} -i tun127 -b
|
||||
sleep 5
|
||||
iptables -t nat -A POSTROUTING -o tun127 -j MASQUERADE
|
||||
|
||||
/bin/sh
|
||||
6
scripts/connect.sh.bak
Normal file
6
scripts/connect.sh.bak
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
echo ${ANYCONNECT_PASSWORD} |openconnect ${ANYCONNECT_SERVER} --user=${ANYCONNECT_USER} --authgroup=DEV -i tun127 -b
|
||||
sleep 5
|
||||
iptables -t nat -A POSTROUTING -o tun127 -j MASQUERADE
|
||||
|
||||
/bin/sh
|
||||
Loading…
x
Reference in New Issue
Block a user