La imagen de Docker CentOS no inicia automáticamente httpd
Estoy intentando ejecutar una imagen Docker simple con Apache y un programa PHP. Funciona bien si corro
docker run -t -i -p 80:80 my/httpd /bin/bash
luego iniciar manualmente Apache
service httpd start
sin embargo no puedo hacer que httpd se inicie automáticamente cuando se ejecuta
docker run -d -p 80:80 my/httpd
Apache se iniciará entonces el contenedor existe. He intentado un montón de diferentesCMD
s en mi archivo docker
CMD /etc/init.d/httpd start
CMD ["service" "httpd" "start"]
CMD ["/bin/bash", "/etc/init.d/httpd start"]
ENTRYPOINT /etc/init.d/httpd CMD start
CMD ./start.sh
start.sh es
#!/bin/bash
/etc/init.d/httpd start
Sin embargo, siempre existirá una instancia de docker después de que se inicie Apache
¿Me estoy perdiendo algo realmente obvio?