问题描述
根据 Alpine wiki 我必须运行 rc-service apache2 start
安装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
issue 183 说明 docker Alpine 镜像没有 service
或 rc-service
.
gliderlabs/docker-alpine
issue 183 illustrate the docker Alpine image has no service
or rc-service
.
你可以看到 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!