First time after git cloning the project
docker-compose -p $project_name$ up --build or if you need to run in detached mode docker-compose -p $project_name$ up -d --build
Sub-sequent executions
docker-compose -p $project_name$ up
then you must use the same name with other docker-compose commands
- docker-compose ps
- docker-compose -p $project_name$ ps
- docker-compose logs -f $service_name$
- docker-compose -p $project_name$ logs
- docker-compose -p $project_name$ logs -f $service_name$
docker-compose -p $project_name$ restart
docker-compose -p $project_name$ restart $service_name$
docker stop $(docker ps -a -q)
docker-compose -p $project_name$ down -v
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
Docker provides a single command that will clean up any resources — images, containers, volumes, and networks — that are dangling (not associated with a container):
docker system prune
To additionally remove any stopped containers and all unused images (not just dangling images), add the -a flag to the command:
docker system prune -a