Difference between revisions of "Docker"
(→Deleting/Cleaning) |
(→Starting/Stopping) |
||
Line 16: | Line 16: | ||
#Remove all docker containers: | #Remove all docker containers: | ||
#*<pre>docker stop $(docker ps -a -q)</pre> | #*<pre>docker stop $(docker ps -a -q)</pre> | ||
+ | #Starting all docker containers with compose: | ||
+ | #*<pre>docker-compose up</pre> | ||
+ | #Stopping all docker containers with compose: | ||
+ | #*<pre>docker-compose down</pre> | ||
==Accessing Container== | ==Accessing Container== |
Revision as of 06:50, 28 January 2025
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