我使用httpd
image:
sudo docker run -dt -p 8080:80 httpd
验证了它的工作原理
我在容器内打开了shell:
docker exec -it <container_id> bash
我更改了位于以下位置的默认网页内容(index.html
)
/usr/local/apache2/htdocs/index.html
我想看到新的变化但是当我刷新页面时没有任何事情发生
我重新启动了容器,它仍显示默认网页
我试图在容器的shell中重新启动httpd
服务,但没有成功,这就是我尝试过的(基于this):
# sudo service apache2 restart
apache2: unrecognized service
# service httpd restart
httpd: unrecognized service
# systemctl start apache2.service
Failed to get D-Bus connection: Unknown error -1
# /etc/init.d/apache2 reload
bash: /etc/init.d/apache2: No such file or directory
答案 0 :(得分:0)
这是FireFox的缓存问题 我在私密浏览时打开它,它工作正常。
验证它的一个好方法是运行:
curl http://localhost:8080
我将返回更新的GET请求。