如何在Docker的Alpine上运行Apache 2? [英] How do I run Apache 2 on Alpine in Docker?
问题描述
根据高山Wiki ,我必须运行 rc-service apache2在安装Apache 2之后开始
。但是,容器内部的Alpine中没有 rc-service
。如何获取服务命令以在Docker容器中运行?
According to Alpine wiki I have to run rc-service apache2 start
after installation of Apache 2. However, there's no rc-service
in the Alpine running inside the container. How do I get the service command to run inside Docker container?
推荐答案
gliderlabs / docker-alpine
问题183 说明了Docker Alpine映像没有 service
或 rc-service
。
您可以看到< a href = https://github.com/nimmis/docker-alpine-apache rel = noreferrer> nimmis / docker-alpine-apache
基于 nimmis / docker-alpine-micro
,其中包括一个runit,用于处理自动启动的启动和关闭过程。
You can see instead nimmis/docker-alpine-apache
based on nimmis/docker-alpine-micro
, which includes a runit, used to handle starting and shutting down processes automatically started.
该initd将启动 apache2脚本,它调用:
That initd will start the apache2 script, which calls:
exec /usr/sbin/httpd -D FOREGROUND -f /web/config/httpd.conf
这篇关于如何在Docker的Alpine上运行Apache 2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!