如何在 Docker 中的 Alpine 上运行 Apache 2?

编程入门 行业动态 更新时间:2024-10-20 00:29:54
本文介绍了如何在 Docker 中的 Alpine 上运行 Apache 2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

根据 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-20 00:48:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/972753.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   Docker   Apache   Alpine

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!