![docker network name docker network name](https://docker-k8s-lab.readthedocs.io/en/latest/_images/docker-overlay.png)
You have to add the -p option to the docker run command as well as the following information: -p :: To allow external connections to the container, you have to open (publish) specific ports. When you run a container, the only way to access the process is from inside of it. Run a Container and Publish Container Ports
![docker network name docker network name](https://image.slidesharecdn.com/dockernetwork-present-160324164513/95/docker-network-present-in-vietnam-dockerday-2015-14-638.jpg)
The command for running a container under a specific name is: docker container run -name įor instance, we can run the sample container and give it the name container_instance using the command: docker container run -name container_instance e98b6ec72f51 Using the -name attribute allows you to assign a container name. Since there is a slim chance you will be able to remember or recognize the containers by these generic names, consider setting the container name to something more memorable.
![docker network name docker network name](https://images.viblo.asia/6529c006-bdeb-4eb2-b46c-b43d00fe56d5.png)
When you use the basic run command, Docker automatically generates a container name with a string of randomly selected numbers and letters. Although Docker still supports docker run, it recommends getting use to the new syntax. Accordingly, run is now a subcommand of docker container and to use it you must type docker container run. Note: With the release of Docker 1.13, Docker introduced a new CLI in which it regrouped commands according to the object they interact with.