how to give name to container in docker code example
Example 1: docker compose Conflict. The container name
Your case is probably related to a bug that will be fixed in the 18.03 release. Some workarounds are proposed here:
https:
https:
docker-compose up builds, (re)creates, starts, and attaches to containers for a service.
Since your images are built and the containers of your service have started, you can then use
docker-compose stop and
docker-compose start
to start/stop your service. This is different from docker-compose down which:
Stops containers and removes containers, networks, volumes, and images created by up.
Regarding the danger of losing your data if a container is removed, read about persistent storage and how to use volumes.
Example 2: docker command to login with user name and pass word
$ docker login localhost:8080