Is there a way to set that the container name will be from inside the Docker file? Basically, I want to always have the same name, so I donβt have to run "$ docker ps" after creating and running the image to get its name.
Dockerfile is for creating images, not containers.
Dockerfile
Now you can specify the names in your containers using the new -name flag for docker run .
-name
docker run
If no name is specified, Docker will automatically generate the name
Is there a reason why you need to define it in the docker file, and not just indicate your containers at startup?
If you use docker launcher to launch your images, provide a name on the command line:
--name="" Assign a name to the container
Docker Run Link