问题原文
原帖链接 · cookie · CC BY-SA 4.0
The following has no effect;
# Dockerfile
FROM php:7-apache
RUN apt-get update && \
apt-get install -y libxml2-dev && \
docker-php-ext-install soap
RUN docker-php-ext-install mysqli
# Enable apache mods.
RUN a2enmod php7.0
RUN a2enmod rewrite
RUN a2enmod headers
i.e. the mod_headers module fails to load?
Do you know a way how to install the mod_headers module within Dockerfile ?
I tried;
CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]
but then the container wouldn't start.
已采纳解答
原帖链接 · madwyatt · CC BY-SA 4.0
Add this to your Dockerfile:
RUN cp /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/ && \
cp /etc/apache2/mods-available/headers.load /etc/apache2/mods-enabled/
That code will enable mod_rewrite and mod_headers.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
