The aim of this repository is to collect useful docker-compose files with different services so that they can help other developers to ease their work.
Feel free to add your own or someone else's docker-compose files.
Don't forget to leave a ⭐ if you found this useful.
Create and start containers
$> docker-compose up
$> docker-compose up -d #Detached mode: Run containers in the background, print new container names.
Stop and remove containers, networks, images, and volumes
$> docker-compose down
Execute a command in a running container
$> docker-compose exec <servicename> sh #Get into container
$> docker-compose exec <servicename> /bin/bash #Get into container
$> docker-compose exec <servicename> pwd #Run command and exit
View output from containers.
$> docker-compose logs
$> docker-compose logs -f #View output from containers.
Stop and remove all docker containers
$> docker stop $(docker ps -a -q)
$> docker rm $(docker ps -a -q)
Remove all docker images
$> docker rmi $(docker images -q)
Deleting all the volumes
Once all the containers are deleted, you can delete all the Docker volumes on your computer using the following command
$> docker volume prune
Deleting all docker data
$> docker system prune -a
Copy file from container to host
$> docker cp <containerId>:/file/path/within/container /host/path/target
Building an image
$> docker build -t <imagename:tag> .
- Install Docker Engine on Ubuntu | Docker Documentation
- Install Docker Compose | Docker Documentation
- Compose file version 3 reference | Docker Documentation
- Compose file version 2 reference | Docker Documentation
- Installing the Docker client on Windows Subsystem for Linux (Ubuntu)
- How To Change Docker Data Folder Configuration - Developer Space - Medium
- HOW TO KEEP DOCKER CONTAINERS RUNNING
- What security concerns should I have with Docker? How should I go about locking it down? · Issue #17 · BretFisher/ama