docker
group. docker ps -a docker rm ......
$ docker run hello-world … Hello from Docker! This message shows that your installation appears to be working correctly. …
docker
group. $USER
) to this group will solve the issue: sudo usermod -aG docker $USER
newgrp - docker
), the docker commands should now be executable. curl -sSL https://get.docker.com | sh
wget -qO- https://get.docker.com | sh
sudo apt-get install docker.io
sudo usermod -aG docker
sudo service docker start
$ docker pull scratch Using default tag: latest Error response from daemon: 'scratch' is a reserved name
/bin/sh
): $ docker run --rm -it --name alpine-ps-test alpine /bin/sh
/ # sleep 101 &
/ # sleep 102 / #
sleep 10\d
in their arguments, and print their parent process id: $ ps a -o pid,ppid,tty,args | grep -P 'sleep 10\d' 13804 13697 pts/0 sleep 101 13805 13697 pts/0 sleep 102
/bin/sh
that started the sleep
commands. Its parent process is 13678: $ ps p 13697 -o pid,ppid,tty,args PID PPID TT COMMAND 13697 13678 pts/0 /bin/sh
$ ps p 13678 -o pid,ppid,tty,args PID PPID TT COMMAND 13678 1 ? /usr/bin/containerd-shim-runc-v2 -namespace moby -id f2789b4f06090dc6a4cbea3d3d9ca1c70a2700bf4ca23c02bbc64843a690a9b8 -address /run/containerd/containerd.sock
$ cat /proc/13804/status | grep NSpid
IMG=debian TOKEN=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:library/$IMG:pull" | jq -r .token) curl -s -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/library/$IMG/tags/list | jq .
debian:bullseye-slim
which looks interesting: $ docker pull debian:bullseye-slim
$ docker pull debian:bullseye-slim
$ docker run -it --name deb-test debian:bullseye-slim bash root@315475baed4a:/# touch /tmp/touched root@315475baed4a:/# exit
$ docker ps
$ docker ps -a
$ docker start -i deb-test
root@315475baed4a:/# ls -1 /tmp touched
root@315475baed4a:/# useradd -s /bin/bash -m rene root@315475baed4a:/# exit
$ docker start deb-test deb-test
$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 315475baed4a debian:bullseye-slim "bash" 43 minutes ago Up 48 seconds deb-test
$ docker exec --user rene -it deb-test /bin/bash rene@315475baed4a:/$ pwd /