Last active
December 10, 2019 14:50
-
-
Save wisniewski94/2c00d8d1cb62d56d64df86108adee17c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DOCKER | |
docker build # Builds Docker images from a Dockerfile | |
docker run -it <container id> bash # Run bash inside docker container | |
# CONTAINERS | |
docker ps -a # List running containers | |
docker container ls -a # List containers | |
docker restart <container> # Restart container | |
docker stop $(docker ps -aq) # Stop all containers | |
docker rm $(docker ps -a -q) # Remove all containers | |
#IMAGES | |
docker image ls -a # List images | |
docker rmi $(docker images -q) # Remove all images | |
docker rmi <container> -f # Force image remove | |
# COMPOSE | |
docker-compose up -d # Build docker compose file and run it in detach mode | |
docker-compose up --no-cache # Build docker compose file from scratch every time | |
docker-compose down # Deletes container and network but not an image | |
docker-compose build # Rebuild image | |
docker-compose ps # List running containers created with docker-compose | |
docker-compose logs <service> # Show container logs | |
docker-compose exec <service> sh # Run shell inside service | |
-u <user> # Run as user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment