Useful docker-compose files with different services.
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 downExecute 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 exitView 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 pruneDeleting all docker data
$> docker system prune -aCopy file from container to host
$> docker cp <containerId>:/file/path/within/container /host/path/targetBuilding 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