Docker用通配符组成额外的主机
我试图创build一个基于PHP的容器:5-apache与许多虚拟主机一样
-
account.site1.local
-
account.site2.local
-
account.site3.local
我可以在apache conf中添加所有带有通配符的虚拟主机。 有没有可能为hosts文件做类似的事情?
Docker在运行容器时设置hosts
文件,所以你不想手动编辑它。 相反,您可以使用add-host
选项:
> docker run --add-host 1.local:127.0.0.1 alpine ping 1.local PING 1.local (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.050 ms
在run
命令中可以有多个add-host
选项。
在Docker Compose中,等效的是extra-hosts
:
extra_hosts: - "1.local:127.0.0.1" - "2.local:127.0.0.1"
- Kubernetes – dynamicconfiguration存储
- 盐:'dockerng'__virtual__返回False
- Bluemix`docker exec`返回404
- Kubernetes无法在给定的IP上看到我的应用程序
- 在特拉维斯CIcaching泊坞窗图像
- 我怎样才能从外部主机使用macvlannetworkingping本地docker容器?
- 无法连接到在vagrant vm中运行的dockerised mysql
- Docker-machine create:预创build检查错误:“Hyper-v命令必须以pipe理员身份运行”
- docker集装箱运行时应用configuration