2017-07-13 01:15:48 +02:00
|
|
|
[Unit]
|
|
|
|
Description=Docker Application Container Engine
|
2019-02-17 07:02:05 +01:00
|
|
|
Documentation=https://docs.docker.com
|
|
|
|
<% if @docker_socket.nil? %>
|
|
|
|
After=network-online.target firewalld.service
|
|
|
|
<% else %>
|
|
|
|
After=network-online.target <%= @docker_name %>.socket firewalld.service
|
|
|
|
Requires=<%= @docker_name %>.socket
|
|
|
|
<% end %>
|
|
|
|
Wants=network-online.target
|
2017-07-13 01:15:48 +02:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=notify
|
|
|
|
<% if @config.http_proxy %>
|
|
|
|
Environment="HTTP_PROXY=<%= @config.http_proxy %>"
|
|
|
|
<% end %>
|
|
|
|
<% if @config.https_proxy %>
|
|
|
|
Environment="HTTPS_PROXY=<%= @config.https_proxy %>"
|
|
|
|
<% end %>
|
|
|
|
<% if @config.no_proxy %>
|
|
|
|
Environment="NO_PROXY=<%= @config.no_proxy %>"
|
|
|
|
<% end %>
|
|
|
|
<% if @config.tmpdir %>
|
|
|
|
Environment="TMPDIR=<%= @config.tmpdir %>"
|
|
|
|
<% end %>
|
2019-02-17 07:02:05 +01:00
|
|
|
<% @env_vars.each do |key, val| %>
|
|
|
|
Environment="<%= key %>=<%= val %>"
|
|
|
|
<% end unless @env_vars.nil? %>
|
2017-07-13 01:15:48 +02:00
|
|
|
<% if @config.ipv4_forward %>
|
|
|
|
ExecStartPre=/sbin/sysctl -w net.ipv4.ip_forward=1
|
|
|
|
<% end %>
|
|
|
|
<% if @config.ipv6_forward %>
|
|
|
|
ExecStartPre=/sbin/sysctl -w net.ipv6.conf.all.forwarding=1
|
|
|
|
<% end %>
|
|
|
|
ExecStart=<%= @docker_daemon_cmd %>
|
|
|
|
ExecStartPost=<%= @docker_wait_ready %>
|
2019-02-17 07:02:05 +01:00
|
|
|
ExecReload=/bin/kill -s HUP $MAINPID
|
|
|
|
<% if @config.mount_flags %>
|
|
|
|
MountFlags=<%= @config.mount_flags %>
|
|
|
|
<% end %>
|
2017-07-13 01:15:48 +02:00
|
|
|
LimitNOFILE=1048576
|
2019-02-17 07:02:05 +01:00
|
|
|
LimitNPROC=infinity
|
2017-07-13 01:15:48 +02:00
|
|
|
LimitCORE=infinity
|
2019-02-17 07:02:05 +01:00
|
|
|
TasksMax=infinity
|
|
|
|
TimeoutStartSec=0
|
|
|
|
Delegate=yes
|
|
|
|
KillMode=process
|
|
|
|
Restart=always
|
|
|
|
StartLimitBurst=3
|
|
|
|
StartLimitInterval=60s
|
2017-07-13 01:15:48 +02:00
|
|
|
<%= @systemd_args %>
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|