| 1 | To see what containers there are : |
| 2 | |
| 3 | {{{sudo docker ps -a}}} |
| 4 | |
| 5 | {{{sudo docker ps -l}}} |
| 6 | |
| 7 | To remove a container : |
| 8 | |
| 9 | {{{sudo docker rm desperate_galileo}}} |
| 10 | |
| 11 | To remove all containers : |
| 12 | |
| 13 | {{{sudo docker rm $(sudo docker ps -a -q)}}} |
| 14 | |
| 15 | To remove an image : |
| 16 | |
| 17 | {{{sudo docker images}}} |
| 18 | |
| 19 | {{{sudo docker rmi 7152fe63199f}}} |
| 20 | |
| 21 | To remove all images : |
| 22 | |
| 23 | {{{sudo docker rmi $(sudo docker images -q)}}} |
| 24 | |
| 25 | To build a container : |
| 26 | |
| 27 | {{{sudo docker build -t lcbruit/redcap:v1 .}}} |
| 28 | |
| 29 | {{{sudo docker build --no-cache -t lcbruit/redcap:v1 .}}} |
| 30 | |
| 31 | To run a container : |
| 32 | |
| 33 | {{{sudo docker run -t -i lcbruit/redcap:v1 /bin/bash}}} |
| 34 | |
| 35 | {{{sudo docker run -p 8080:80 -d lcbruit/redcap:v1}}} |
| 36 | |
| 37 | {{{sudo docker run -i -t -p 8080:80 lcbruit/redcap:v1 /bin/bash}}} |
| 38 | |
| 39 | To tag an image : |
| 40 | |
| 41 | {{{sudo docker tag 72d49f94ad66 lcbruit/redcap:devel}}} |
| 42 | |
| 43 | To view images : |
| 44 | |
| 45 | {{{sudo docker images lcbruit/redcap}}} |
| 46 | |
| 47 | To stop a docker : |
| 48 | |
| 49 | {{{sudo docker stop elated_bardeen}}} |
| 50 | |
| 51 | Docker logs : |
| 52 | |
| 53 | {{{sudo docker logs condescending_perlman}}} |
| 54 | |
| 55 | Misc : |
| 56 | |
| 57 | {{{sudo docker run -name redcap -i -t lcbruit/redcap:v1}}} |
| 58 | |
| 59 | {{{sudo docker run -t -i ubuntu /bin/bash}}} |
| 60 | |
| 61 | Connect to existing container : |
| 62 | |
| 63 | {{{sudo docker exec -i -t 4cd90347c851 /bin/bash}}} |