I am looking for a way to assign a domain name to the container when it is started. For example, I want to start a web server container, and to be able to access web pages via domain name. Is there an easy way to do this ?
相关问题
- Docker task in Azure devops won't accept "$(pw
- Unable to run mariadb when mount volume
- Unspecified error (0x80004005) while running a Doc
- What would prevent code running in a Docker contai
- How to reload apache in php-apache docker containe
For all I know,
Docker
doesn't provide this feature out of the box. But surely there are several workarounds here. In fact you need to deploy a DNS on your host that will distinguish the containers and resolve their domain names in dynamical IPs. So you could give a try to:SkyDNSv1
/SkyDock
);SkyDNS
makes the containers know each other by name, but the host is not aware of it);--hostname
(you will probably use schemecontainer_name.image_name.dev.skydns.local
).You can skip step #2 and run your browser inside container too: it will discover the web application container by hostname.