Assign domain name to the container

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 ?

  • Add insecure rubygems source and automatically choose 'yes' for 'Do you want to add this insecure source?' (I'm using Docker-Compose)
  • Storing secret env variables as separate data container in Docker
  • Best way to transfer data to named volume of Docker
  • How to configure the publish address of elasticsearch 5.0 with CLI flags?
  • Docker: open container port to all other containers
  • How to force a docker container in IBM Bluemix to connect a volume?
  • How can I overwrite a file through Dockerfile in docker container?
  • Docker0 interface in CoreOS and Digital Ocean
  • aws container service \ how dockers configured for communicating with each other
  • docker-compose as vagrant provider?
  • Containers are being spawned however the issued command fails when spawning multiple number of docker containers
  • Running docker Ubuntu image on Debian enironment
  • One Solution collect form web for “Assign domain name to the container”

    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:

    1. Deploy some of Docker-aware DNS solutions (I suggest you to use SkyDNSv1/SkyDock);
    2. Configure your host to work with this DNS (by default SkyDNS makes the containers know each other by name, but the host is not aware of it);
    3. Run your containers with explicit --hostname (you will probably use scheme

    You can skip step #2 and run your browser inside container too: it will discover the web application container by hostname.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.