优化Dockerfile使用

This commit is contained in:
bjdgyc
2021-04-09 14:49:41 +08:00
parent 9b509c33f3
commit d8eb8ab7ed
8 changed files with 201 additions and 48 deletions

23
docker_entrypoint.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
var1=$1
#set -x
case $var1 in
"bash" | "sh")
echo $var1
exec "$@"
;;
"tool")
/app/anylink "$@"
;;
*)
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -s "${IPV4_CIDR}" -o eth0+ -j MASQUERADE
# iptables -nL -t nat
/app/anylink "$@"
;;
esac