Last active
October 1, 2021 08:07
-
-
Save NileshPatel17/e03a72d8689bab4b2d015f6c7753f6eb to your computer and use it in GitHub Desktop.
Revisions
-
NileshPatel17 revised this gist
Oct 1, 2021 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -30,4 +30,10 @@ docker exec -i -t -u root /bin/bash Remove all unused containers, volumes, networks and images ```javascript docker system prune -a --volumes ``` view container log ``` docker logs -f 49725ba5da0f ``` -f, --follow Follow log output -
NileshPatel17 revised this gist
Jul 23, 2021 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -23,3 +23,11 @@ bash shell with root if container is running in a different user context ```javascript docker exec -i -t -u root /bin/bash ``` delete all containers including its volumes use ```javascript docker rm -vf $(docker ps -a -q) ``` Remove all unused containers, volumes, networks and images ```javascript docker system prune -a --volumes ``` -
NileshPatel17 revised this gist
Jul 23, 2021 . 1 changed file with 25 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,25 @@ # Docker commands: kill all running containers ```javascript docker kill $(docker ps -q) ``` delete all stopped containers ```javascript docker rm $(docker ps -a -q) ``` delete all images ```javascript docker rmi $(docker images -q) ``` update and stop a container that is in a crash-loop ```javascript docker update --restart=no && docker stop ``` bash shell into container (if bash is not available use /bin/sh) ```javascript docker exec -i -t /bin/bash ``` bash shell with root if container is running in a different user context ```javascript docker exec -i -t -u root /bin/bash ``` -
NileshPatel17 revised this gist
Jul 23, 2021 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1 +1,7 @@ ### docker commands: kill all running containers with docker kill $(docker ps -q) delete all stopped containers with docker rm $(docker ps -a -q) delete all images with docker rmi $(docker images -q) update and stop a container that is in a crash-loop with docker update --restart=no && docker stop bash shell into container docker exec -i -t /bin/bash - if bash is not available use /bin/sh bash shell with root if container is running in a different user context docker exec -i -t -u root /bin/bash -
NileshPatel17 created this gist
Jul 23, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@