How to restart apache2 without terminating docker container?

后端 未结 5 1005
甜味超标
甜味超标 2021-02-02 10:29

I am using as a base the php docker container with the tag:

php:5.6-apache

When I try to restart the apache2 inside the container, the containe

5条回答
  •  时光取名叫无心
    2021-02-02 11:16

    If you use apache as the primary service to keep your running container, you can NOT reboot it. Simply because you built the image and sets the CMD with it.

    The main purpose of a CMD is to provide defaults for an executing container. These defaults can include an executable, or they can omit the executable, in which case you must specify an ENTRYPOINT instruction as well.

    Try to reload without restart a service:

    /etc/init.d/apache2 reload
    

提交回复
热议问题