linux - 从 Dockerfile 安装 Apache

标签 linux docker apache ubuntu

我想创建一个包含 Apache Web 服务器(在 Ubuntu 中运行)的 docker 镜像。
当docker执行命令RUN apt install apache2 -y ,图像创建过程停止等待地理区域,并且无法在终端中手动设置。我想为欧洲设置“8”,然后为马德里设置“29”。
有没有办法在一个简单的行命令中稳定这些信息?

最佳答案

这会在没有提示的情况下安装 Apache 和 tzdata,然后将时区设置为马德里。

FROM ubuntu:22.04
RUN apt-get update && DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y apache2 tzdata
ENV TZ=Europe/Madrid

关于linux - 从 Dockerfile 安装 Apache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72672759/

相关文章:

linux - shell 脚本运行时间过长时的通知

python - Linux 上的 Gtk+ 版本错误

python - 用于非 Web 应用程序的 Python 工作流和 Docker + IDE

python - Windows10 的 Docker 运行 django 失败 : Can't open file 'manage.py' : [Errno 2] No such file or directory

php - .htaccess 打开 .css 而不是 .php

linux - Linux 中的 Shift+Space 下划线(不带 xmodmap)

linux - ld.so 替代品

r - Docker中的ShinyDirButton与fileInput

apache - 我如何强制 URL 区分大小写

python - 从 CGI 脚本启动后台进程/守护进程