So far, when we've operated on the containers, we've always used auto-generated names. This approach has some advantages, such as the names being unique (no naming conflicts) and automatic (no need to do anything). In many cases, however, it's better to give a user-friendly name to the container or the image.
Using names in Docker
Naming containers
There are two good reasons to name the container: convenience and the possibility of automation. Let's look at why:
- Convenience: It's simpler to make any operations on the container when addressing it by name than by checking the hashes or the auto-generated name
- Automation: Sometimes, we would like to depend on the specific naming of the container
For...