| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| docker:run-stop-containers [2024/02/19 21:20] – odefta | docker:run-stop-containers [2024/02/23 17:40] (current) – odefta |
|---|
| | ====== Display running docker containers ====== |
| | |
| | <code> |
| | docker ps |
| | </code> |
| | Output: |
| | <code> |
| | e26c2dcdc6a0 ee8449491514 "/agentk_linux_amd64…" 41 minutes ago Up 41 minutes k8s_gitlab-agent_odefta1-gitlab-agent-v2-6b8794f498-k62hm_gitlab-agent-odefta1_9f56a2c4-d4fb-4cba-9455-a84eadd25c18_5 |
| | b8a3da1af510 cbb01a7bd410 "/coredns -conf /etc…" 41 minutes ago Up 41 minutes k8s_coredns_coredns-76f75df574-6w59t_kube-system_28ba864d-d233-4988-a722-43cc3047da85_6 |
| | 32bdc9aabb3f 43c6c10396b8 "/usr/local/bin/kube…" 41 minutes ago Up 41 minutes k8s_kube-proxy_kube-proxy-6mwkp_kube-system_3f8f06c3-164e-4685-bce9-17ee990f1eca_6 |
| | e319f3296383 registry.k8s.io/pause:3.9 "/pause" 41 minutes ago Up 41 minutes k8s_POD_vpnkit-controller_kube-system_5060ecc9-2d01-4f2c-bd51-984045dbf482_6 |
| | 42b90dc323ee registry.k8s.io/pause:3.9 "/pause" 41 minutes ago Up 41 minutes k8s_POD_coredns-76f75df574-6w59t_kube-system_28ba864d-d233-4988-a722-43cc3047da85_6 |
| | </code> |
| | |
| | ====== Display all docker containers ====== |
| | |
| | <code> |
| | docker ps -a |
| | </code> |
| | |
| | ====== Connect to an existing running container to execute commands ====== |
| | |
| | -it accepts container id or name |
| | <code> |
| | docker exec -it b1faf04f660b bash |
| | </code> |
| | |
| ====== Run a docker container ====== | ====== Run a docker container ====== |
| |
| If no registry is specified, the docker command will search in Docker Hub (https://registry.hub.docker.com/v2/) | If no registry is specified, the docker command will search in Docker Hub (https://registry.hub.docker.com/v2/) |
| </note> | </note> |
| |
| ===== Display running docker containers ===== | |
| |
| <code> | |
| docker ps | |
| </code> | |
| Output: | |
| <code> | |
| e26c2dcdc6a0 ee8449491514 "/agentk_linux_amd64…" 41 minutes ago Up 41 minutes k8s_gitlab-agent_odefta1-gitlab-agent-v2-6b8794f498-k62hm_gitlab-agent-odefta1_9f56a2c4-d4fb-4cba-9455-a84eadd25c18_5 | |
| b8a3da1af510 cbb01a7bd410 "/coredns -conf /etc…" 41 minutes ago Up 41 minutes k8s_coredns_coredns-76f75df574-6w59t_kube-system_28ba864d-d233-4988-a722-43cc3047da85_6 | |
| 32bdc9aabb3f 43c6c10396b8 "/usr/local/bin/kube…" 41 minutes ago Up 41 minutes k8s_kube-proxy_kube-proxy-6mwkp_kube-system_3f8f06c3-164e-4685-bce9-17ee990f1eca_6 | |
| e319f3296383 registry.k8s.io/pause:3.9 "/pause" 41 minutes ago Up 41 minutes k8s_POD_vpnkit-controller_kube-system_5060ecc9-2d01-4f2c-bd51-984045dbf482_6 | |
| 42b90dc323ee registry.k8s.io/pause:3.9 "/pause" 41 minutes ago Up 41 minutes k8s_POD_coredns-76f75df574-6w59t_kube-system_28ba864d-d233-4988-a722-43cc3047da85_6 | |
| </code> | |
| |
| ===== Display all docker containers ===== | |
| |
| <code> | |
| docker ps -a | |
| </code> | |
| |
| ====== Stop a running docker container ====== | ====== Stop a running docker container ====== |