如何在 Docker 中的 Alpine 上运行 Apache 2? [英] How do I run Apache 2 on Alpine in Docker?

查看:28
本文介绍了如何在 Docker 中的 Alpine 上运行 Apache 2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 Alpine wiki 我必须运行 rc-service apache2 start安装Apache 2后.但是,在容器内运行的Alpine中没有rc-service.如何让服务命令在 Docker 容器内运行?

According to Alpine wiki I have to run rc-service apache2 startafter 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 镜像没有 servicerc-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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆