0 votes
1 view
in Devops and Agile by (2.3k points)

Hey there, new to docker here. So i was running the command docker ps -a, when I get this:

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

I did not mention any name, what is this name insane_kirch6 used for?

1 Answer

0 votes
by (6.5k points)

That is the name of your container. You can go ahead and name your container using the '--name' flag in your container run command. Since you did not give a name for the container docker generated a random name one

Example of naming a container:
$ sudo docker run --name my_container ubuntu
the above command should startup an ubuntu container with the name my_container.
Naming containers is important for establish links, Docker relies on the names of your containers to make any sort of connections between each other.

To get to know more about how docker containers and the linking between them works check out docker training course.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...