Files
Schulung_Docker_k8s/docker_commands
2022-12-14 14:37:30 +01:00

36 lines
1.1 KiB
Plaintext

docker container run -ti -d -p 127.0.0.1:8080:80 --name nginx nginx:1.19.3
curl http://127.0.0.1:8080
docker exec -ti nginx /bin/sh
apt update
apt install -y iproute2
apt install -y procps
# show separate process namespace
ps -ef
# show separate network namespace
ip a s
exit
# show host process and network interfaces
ps -ef
ip a s
# commit tools
docker container stop nginx
docker container commit $(docker container ls -lq) nginx:1.19.3-tools
docker image ls
docker image history nginx:1.19.3-tools
docker container start nginx
ps fax
5006 ? Sl 0:00 \_ /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 49154 -container-ip 172.1
7343 ? Sl 0:01 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 6e0451b73ddbfae0976a5146e6cda92c
7366 ? Ss 0:00 \_ nginx: master process nginx -g daemon off;
7425 ? S 0:00 \_ nginx: worker process
7426 ? S 0:00 \_ nginx: worker process
7427 ? S 0:00 \_ nginx: worker process
7428 ? S 0:00 \_ nginx: worker process
docker stats zeigt den verbrauch an.
docker context