diff --git a/roles/docker/templates/systemd.j2 b/roles/docker/templates/systemd.j2 index a0658a224280029b302ebf4831dde72d931718fe..7d7ebc38cacf850c3953bf6d7421da94cbb1efdd 100644 --- a/roles/docker/templates/systemd.j2 +++ b/roles/docker/templates/systemd.j2 @@ -8,7 +8,7 @@ TimeoutStartSec=0 EnvironmentFile=-/etc/default/{{ service.name }}-{{ container.name }} ExecStartPre=/usr/bin/docker pull {{ container.image }} # Minimum set: --cgroups name=systemd -ExecStart=/usr/bin/systemd-docker --env run --rm --name {{ service.name }}-{{ container.name }} {% if container.resources is defined %}{% if container.resources.ram is defined %}--memory={{ container.resources.ram }}{% endif %} {% if container.resources.cpu is defined %}--cpus={{ container.resources.cpu }}{% endif %}{% endif %} --network host --expose {{ container.port }} --mount type=bind,source=/dev/log,destination=/dev/log {% for creds in service.get('service_credentials', []) %} --mount type=bind,source=/etc/credentials/x509/{{ creds.name }},destination=/etc/credentials/x509/{{ creds.name }}{% endfor %} {% for mount in container.get('volumes', []) %} --mount type=bind{% for k, v in mount.iteritems() %},src={{ k }},dst={{ v }}{% endfor %}{% endfor %} {{ container.get('docker_options', '') }} {{ container.image }} {{ container.get('args', '') }} +ExecStart=/usr/bin/systemd-docker --env run --rm --name {{ service.name }}-{{ container.name }} {% if container.resources is defined %}{% if container.resources.ram is defined %}--memory={{ container.resources.ram }}{% endif %} {% if container.resources.cpu is defined %}--cpus={{ container.resources.cpu }}{% endif %}{% endif %} --network host {% if container.get('ports', []) %}--expose {{ container.ports | join(',') }} {% else %}--expose {{ container.port }}{% endif %} --mount type=bind,source=/dev/log,destination=/dev/log {% for creds in service.get('service_credentials', []) %} --mount type=bind,source=/etc/credentials/x509/{{ creds.name }},destination=/etc/credentials/x509/{{ creds.name }}{% endfor %} {% for mount in container.get('volumes', []) %} --mount type=bind{% for k, v in mount.iteritems() %},src={{ k }},dst={{ v }}{% endfor %}{% endfor %} {{ container.get('docker_options', '') }} {{ container.image }} {{ container.get('args', '') }} Restart=always RestartSec=10s Type=notify