cd ~/docker-ocserv
#Download Ubuntu Stable version
FROM ubuntu:latest
# layer 1 china timezone
RUN apt-get update && apt-get -y install unzip gnutls-bin bash iptables curl ocserv && \
echo "Asia/Shanghai" > /etc/timezone
WORKDIR /etc/ocserv
# use volume to map host directory to container directory . to /etc/ocserv
RUN rm -rf /etc/ocserv
COPY entrypoint.sh /entrypoint.sh
run chmod a+x /entrypoint.sh
EXPOSE 22 80 443
ENTRYPOINT ["/entrypoint.sh"]
CMD ["ocserv", "-c", "/etc/ocserv/ocserv.conf", "-f"]
#!/bin/sh
set -e
# open iptables nat
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
exec "$@"
歡迎光臨 電訊茶室 (http://telecom-cafe.com/forum/) | Powered by Discuz! 7.2 |