[Unit] Description=Apache Official Container(https://registry.hub.docker.com/_/httpd/) After=docker.service Requires=docker.service [Service] Type=simple TimeoutStartSec=0 ExecStartPre=-/usr/bin/docker kill apache ExecStartPre=-/usr/bin/docker rm apache ExecStartPre=/usr/bin/docker pull httpd:2.4 ExecStart=/usr/bin/docker run --name apache -p 10080:80 httpd:2.4 ExecStop=/usr/bin/docker stop apache [Install] WantedBy=multi-user.target
$ sudo systemctl daemon-reload $ sudo systemctl enable docker_apache $ sudo systemctl start docker_apache