Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should I use Docker's container name?

Tags:

docker

When I ran docker ps -a, I got

CONTAINER ID        IMAGE                         COMMAND                CREATED             STATUS                      PORTS               NAMES e3be2faeb751        centos:latest   touch /var/log/test   2 minutes ago       Exited (1) 2 minutes ago                        insane_kirch6 

What is the name, insane_kirch6, for?

like image 325
TLJ Avatar asked Aug 10 '14 16:08

TLJ


2 Answers

You can name your own containers with --name when you use docker run. If you do not provide a name, Docker will generate a random one like the one you have.

Check their documentation for naming at Legacy container links, The importance of naming

like image 135
Marcus Hughes Avatar answered Oct 19 '22 04:10

Marcus Hughes


And even more importantly, you can run named containers again later with start:

docker start --interactive named-containter 
like image 25
mrts Avatar answered Oct 19 '22 04:10

mrts