bundles/docker-engine: do not put containers on the host network
This commit is contained in:
parent
aae1e8397e
commit
463443e1e3
2 changed files with 15 additions and 3 deletions
|
@ -18,6 +18,7 @@ PGID="$(id -g "docker-${name}")"
|
||||||
if [ "$ACTION" == "start" ]
|
if [ "$ACTION" == "start" ]
|
||||||
then
|
then
|
||||||
docker run -d \
|
docker run -d \
|
||||||
|
--rm \
|
||||||
--name "${name}" \
|
--name "${name}" \
|
||||||
--env "PUID=$PUID" \
|
--env "PUID=$PUID" \
|
||||||
--env "PGID=$PGID" \
|
--env "PGID=$PGID" \
|
||||||
|
@ -25,9 +26,8 @@ then
|
||||||
% for k, v in sorted(environment.items()):
|
% for k, v in sorted(environment.items()):
|
||||||
--env "${k}=${v}" \
|
--env "${k}=${v}" \
|
||||||
% endfor
|
% endfor
|
||||||
--network host \
|
|
||||||
% for host_port, container_port in sorted(ports.items()):
|
% for host_port, container_port in sorted(ports.items()):
|
||||||
--expose "127.0.0.1:${host_port}:${container_port}" \
|
--publish "127.0.0.1:${host_port}:${container_port}" \
|
||||||
% endfor
|
% endfor
|
||||||
% for host_path, container_path in sorted(volumes.items()):
|
% for host_path, container_path in sorted(volumes.items()):
|
||||||
--volume "/var/opt/docker-engine/${name}/${host_path}:${container_path}" \
|
--volume "/var/opt/docker-engine/${name}/${host_path}:${container_path}" \
|
||||||
|
@ -38,7 +38,6 @@ then
|
||||||
elif [ "$ACTION" == "stop" ]
|
elif [ "$ACTION" == "stop" ]
|
||||||
then
|
then
|
||||||
docker stop "${name}"
|
docker stop "${name}"
|
||||||
docker rm "${name}"
|
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Unknown action $ACTION"
|
echo "Unknown action $ACTION"
|
||||||
|
|
|
@ -18,6 +18,19 @@ defaults = {
|
||||||
'/var/opt/docker-engine',
|
'/var/opt/docker-engine',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'nftables': {
|
||||||
|
'forward': {
|
||||||
|
'docker-engine': [
|
||||||
|
'ct state { related, established } accept',
|
||||||
|
'iifname docker0 accept',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'postrouting': {
|
||||||
|
'docker-engine': [
|
||||||
|
'iifname docker0 masquerade',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
'hosts': {
|
'hosts': {
|
||||||
'entries': {
|
'entries': {
|
||||||
'172.17.0.1': {
|
'172.17.0.1': {
|
||||||
|
|
Loading…
Add table
Reference in a new issue