我这样声明我的服务docker-compose.yml:
wildfly:
image: "myrepo/wildfly:latest"
hostname: wildfly
Run Code Online (Sandbox Code Playgroud)
因此,compose将条目添加到/ etc / hosts:
172.18.0.4 wildfly
Run Code Online (Sandbox Code Playgroud)
凡172.18.0.4由泊坞窗自动生成。
但是我需要绑定some.host.name到此生成的IP,/etc/hosts以在/ etc / hosts中具有多个条目:
172.18.0.4 wildfly
172.18.0.4 some.host.name
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
我尝试使用extra_hosts语法,但是docker-compose.yml我不知道将哪个IP分配给容器。
有人遇到过类似的问题吗?