Docker
Installing Image
- Search docker image
- docker search <image-name> 
 
- Download base image from docker:
- docker run -d --name nginx-test --net <custom-network> <nginx:latest> 
 
Listing
- List All Docker Containers:
- docker ps -a 
 
- List all networks:
- docker network list 
 
- Inspect docker container:
- docker inspect <container id> 
 
Starting/Stopping
- Start docker container:
- docker start <container id> 
 
- Stop docker container:
- docker stop <container id> 
 
- Stop all docker containers:
- docker stop $(docker ps -a -q) 
 
- Remove all docker containers:
- docker stop $(docker ps -a -q) 
 
- Starting all docker containers with compose:
- docker-compose up 
 
- Stopping all docker containers with compose:
- docker-compose down 
 
Accessing Container
- Enter a running conntainer
- docker exec -it <container id> /bin/bash 
 
Deleting/Cleaning
- Removing a single container:
- docker rmi -f <container id> 
 
- Delete no longer needed containers:
- docker container prune 
 
- Delete no longer needed images:
- docker image prune 
 
- Delete no longer needed networks:
- docker network prune 
 
- Delete no longer needed trash:
- docker system prune 
 
