bundles/docker-engine: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARGLLLLLLLLLLLLLLLLLLLLLLLLL
networking is apparently hard
This commit is contained in:
parent
5af3fbe3e0
commit
932ae43621
2 changed files with 20 additions and 3 deletions
|
@ -17,8 +17,9 @@ PGID="$(id -g "docker-${name}")"
|
|||
|
||||
if [ "$ACTION" == "start" ]
|
||||
then
|
||||
docker rm "${name}" || true
|
||||
|
||||
docker run -d \
|
||||
--rm \
|
||||
--name "${name}" \
|
||||
--env "PUID=$PUID" \
|
||||
--env "PGID=$PGID" \
|
||||
|
@ -26,6 +27,7 @@ then
|
|||
% for k, v in sorted(environment.items()):
|
||||
--env "${k}=${v}" \
|
||||
% endfor
|
||||
--network aaarghhh \
|
||||
% for host_port, container_port in sorted(ports.items()):
|
||||
--publish "127.0.0.1:${host_port}:${container_port}" \
|
||||
% endfor
|
||||
|
|
|
@ -28,6 +28,21 @@ files['/usr/local/share/icinga/plugins/check_docker_container'] = {
|
|||
'mode': '0755',
|
||||
}
|
||||
|
||||
actions['docker_create_nondefault_network'] = {
|
||||
# <https://docs.docker.com/engine/network/#dns-services>
|
||||
# By default, containers inherit the DNS settings as defined in the
|
||||
# /etc/resolv.conf configuration file. Containers that attach to the
|
||||
# default bridge network receive a copy of this file. Containers that
|
||||
# attach to a custom network use Docker's embedded DNS server. The embedded
|
||||
# DNS server forwards external DNS lookups to the DNS servers configured on
|
||||
# the host.
|
||||
'command': 'docker network create aaarghhh',
|
||||
'unless': 'docker network ls | grep -q -F aaarghhh',
|
||||
'needs': {
|
||||
'svc_systemd:docker',
|
||||
},
|
||||
}
|
||||
|
||||
for app, config in node.metadata.get('docker-engine/containers', {}).items():
|
||||
volumes = config.get('volumes', {})
|
||||
|
||||
|
@ -54,8 +69,8 @@ for app, config in node.metadata.get('docker-engine/containers', {}).items():
|
|||
'docker',
|
||||
},
|
||||
'after': {
|
||||
# provides docker group
|
||||
'pkg_apt:docker-ce',
|
||||
'action:docker_create_nondefault_network',
|
||||
'svc_systemd:docker',
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue