Sobes.tech
Intern — Junior

How can you set the container name in a containerization environment?

sobes.tech AI

Answer from AI

In Docker, the --name option is used to assign a name to a container when running it with the docker run command. This allows you to refer to the container by the specified name instead of the automatically generated identifier.

Example:

docker run --name my_container nginx

In this example, the container will have the name my_container.