|
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +## Pulling and Listing Images |
| 6 | +```bash |
| 7 | +docker pull spuacv/spuc:latest |
| 8 | +``` |
| 9 | + |
| 10 | +## The structure of a Docker command |
| 11 | +Image: A diagram showing the syntactic structure of a Docker command |
| 12 | + |
| 13 | +## Listing Images |
| 14 | +```bash |
| 15 | +docker image ls |
| 16 | +``` |
| 17 | +## Inspecting |
| 18 | +```bash |
| 19 | +docker inspect spuacv/spuc:latest |
| 20 | +``` |
| 21 | +```bash |
| 22 | +docker inspect spuacv/spuc:latest -f "Command: {{.Config.Cmd}}" |
| 23 | +``` |
| 24 | +```bash |
| 25 | +docker inspect spuacv/spuc:latest -f "Entrypoint: {{.Config.Entrypoint}}" |
| 26 | +``` |
| 27 | +```bash |
| 28 | +docker inspect spuacv/spuc:latest -f $'Command: {{.Config.Cmd}}\nEntrypoint: {{.Config.Entrypoint}}' |
| 29 | +``` |
| 30 | + |
| 31 | +## Default Command |
| 32 | +Image: A diagram representing the lifecycle of a container |
| 33 | + |
| 34 | +### Further examples of container lifecycle |
| 35 | +Image: Further details and examples of the lifecycle of a container |
| 36 | + |
| 37 | + |
| 38 | +## Running |
| 39 | +```bash |
| 40 | +docker run spuacv/spuc:latest |
| 41 | +``` |
| 42 | +```bash |
| 43 | +docker run -d spuacv/spuc:latest |
| 44 | +``` |
| 45 | +## Listing Containers |
| 46 | +```bash |
| 47 | +docker ps |
| 48 | +``` |
| 49 | +```bash |
| 50 | +docker ps -a |
| 51 | +``` |
| 52 | +## Logs |
| 53 | +```bash |
| 54 | +docker logs ecstatic_nightingale |
| 55 | +``` |
| 56 | +```bash |
| 57 | +curl -X PUT localhost:8321/unicorn_spotted?location=moon\&brightness=100 |
| 58 | +``` |
| 59 | +## Exposing ports |
| 60 | +```bash |
| 61 | +docker run -d -p 8321:8321 spuacv/spuc:latest |
| 62 | +``` |
| 63 | +```bash |
| 64 | +docker ps |
| 65 | +``` |
| 66 | +```bash |
| 67 | +curl -X PUT localhost:8321/unicorn_spotted?location=moon\&brightness=100 |
| 68 | +``` |
| 69 | +```bash |
| 70 | +docker logs unruffled_noyce |
| 71 | +``` |
| 72 | +## Setting the name of a container |
| 73 | +```bash |
| 74 | +docker run -d --name spuc_container -p 8321:8321 spuacv/spuc:latest |
| 75 | +``` |
| 76 | +```bash |
| 77 | +docker stop unruffled_noyce |
| 78 | +docker rm unruffled_noyce |
| 79 | +``` |
| 80 | + |
| 81 | +### Killing containers |
| 82 | +```bash |
| 83 | +docker kill ecstatic_nightingale |
| 84 | +``` |
| 85 | + |
| 86 | +```bash |
| 87 | +docker run -d --name spuc_container -p 8321:8321 spuacv/spuc:latest |
| 88 | +``` |
| 89 | +```bash |
| 90 | +docker logs -f spuc_container |
| 91 | +``` |
| 92 | + |
| 93 | +### Logs |
| 94 | + |
| 95 | +## Executing commands in a running container |
| 96 | +```bash |
| 97 | +docker exec spuc_container cat config/print.config |
| 98 | +``` |
| 99 | +```bash |
| 100 | +docker exec -it spuc_container bash |
| 101 | +``` |
| 102 | +```bash |
| 103 | +apt update |
| 104 | +apt install tree |
| 105 | +tree |
| 106 | +``` |
| 107 | + |
| 108 | +## Interactive sessions |
| 109 | +```bash |
| 110 | +docker run -it alpine:latest |
| 111 | +``` |
| 112 | + |
| 113 | +## Reviving Containers |
| 114 | +```bash |
| 115 | +docker kill spuc_container |
| 116 | +``` |
| 117 | +```bash |
| 118 | +docker start spuc_container |
| 119 | +``` |
| 120 | +```bash |
| 121 | +docker stats |
| 122 | +``` |
| 123 | +## Cleaning up |
| 124 | +```bash |
| 125 | +docker kill spuc_container |
| 126 | +``` |
| 127 | +```bash |
| 128 | +docker rm spuc_container |
| 129 | +``` |
| 130 | +```bash |
| 131 | +docker image rm spuacv/spuc:latest |
| 132 | +``` |
| 133 | +```bash |
| 134 | +docker system prune |
| 135 | +``` |
| 136 | +### Automatic cleanup |
| 137 | +```bash |
| 138 | +docker run -d --rm --name spuc_container -p 8321:8321 spuacv/spuc:latest |
| 139 | +``` |
| 140 | + |
| 141 | + |
0 commit comments