How to specify container names?

QuestionsQuestions8 SkillsProYour First Docker LabOct, 30 2025
082

You can specify a container name using the --name option in the docker run command. Here’s the syntax:

docker run --name your_container_name image_name

For example, to run a container from the nginx image with the name my_nginx, you would use:

docker run --name my_nginx nginx

This way, you can easily reference the container by its name in future Docker commands.

0 Comments

no data
Be the first to share your comment!