$ whatis docker

docker (1) - Docker image and container command line interface

# docker info
Client:
 Debug Mode: false
Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 19.03.13
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8fba4e9a7d01810a393d5d25a3621dc101981175
 runc version: 
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-67-generic
 Operating System: Ubuntu Core 18
 OSType: linux
 Architecture: x86_64
 CPUs: 6
 Total Memory: 15.62GiB
 Name: u22942380
 ID: KAD6:ID6C:S7MY:QPU4:7CYN:O7RW:HPSZ:OEN2:QYDO:IGA2:YZ3D:ZCSA
 Docker Root Dir: /var/snap/docker/common/var-lib-docker
 Debug Mode: false
 Username: hlutfy
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support
# docker version
Client:
 Version:           19.03.6
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        369ce74a3c
 Built:             Fri Dec 18 12:21:44 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       bd33bbf
  Built:            Fri Feb  5 15:58:24 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx

Pulling fs layer [1B
Pulling fs layer [1B
Pulling fs layer [1B
Pulling fs layer [1B
Pulling fs layer [1B
Pulling fs layer Waiting Downloading

Continues here ...
...

Status: Downloaded newer image for nginx:latest
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              62d49f9bab67        2 weeks ago         133MB
 /var/www/htmlroot@u22942380:/var/www/html# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS               NAMES
c24522a85ec0        nginx               "/docker-entrypoint.…"   About a minute ago   Up About a minute   80/tcp              strange_yonath

c24522a85ec0
# uname -a
Linux c24522a85ec0 5.4.0-67-generic #75~18.04.1-Ubuntu SMP Tue Feb 23 19:17:50 UTC 2021 x86_64 GNU/Linux
# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
# exit
exit
# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              62d49f9bab67        2 weeks ago         133MB
 /var/www/htmlroot@u22942380:/var/www/html# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
c24522a85ec0        nginx               "/docker-entrypoint.…"   2 minutes ago       Up 2 minutes        80/tcp              strange_yonath

127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
172.17.0.2	c24522a85ec0

Linux c24522a85ec0 5.4.0-67-generic #75~18.04.1-Ubuntu SMP Tue Feb 23 19:17:50 UTC 2021 x86_64 GNU/Linux
# docker exec -it c2 ls -l
total 80
drwxr-xr-x   2 root root 4096 Apr  8 00:00 bin
drwxr-xr-x   2 root root 4096 Mar 19 23:44 boot
drwxr-xr-x   5 root root  360 May  4 07:28 dev
drwxr-xr-x   1 root root 4096 Apr 13 19:20 docker-entrypoint.d
-rwxrwxr-x   1 root root 1202 Apr 13 19:20 docker-entrypoint.sh
drwxr-xr-x   1 root root 4096 May  4 07:28 etc
drwxr-xr-x   2 root root 4096 Mar 19 23:44 home
drwxr-xr-x   1 root root 4096 Apr 13 19:20 lib
drwxr-xr-x   2 root root 4096 Apr  8 00:00 lib64
drwxr-xr-x   2 root root 4096 Apr  8 00:00 media
drwxr-xr-x   2 root root 4096 Apr  8 00:00 mnt
drwxr-xr-x   2 root root 4096 Apr  8 00:00 opt
dr-xr-xr-x 247 root root    0 May  4 07:28 proc
drwx------   1 root root 4096 May  4 07:31 root
drwxr-xr-x   1 root root 4096 May  4 07:28 run
drwxr-xr-x   2 root root 4096 Apr  8 00:00 sbin
drwxr-xr-x   2 root root 4096 Apr  8 00:00 srv
dr-xr-xr-x  13 root root    0 May  4 07:28 sys
drwxrwxrwt   1 root root 4096 Apr 13 19:20 tmp
drwxr-xr-x   1 root root 4096 Apr  8 00:00 usr
drwxr-xr-x   1 root root 4096 Apr  8 00:00 var
# systemctl status docker
docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com
# systemctl status docker
docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
   Active: [0;1;32mactive (running)[0m since Tue 2021-05-04 03:32:20 EDT; 4s ago
     Docs: https://docs.docker.com
 Main PID: 19422 (dockerd)
    Tasks: 15
   CGroup: /system.slice/docker.service
           └─19422 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

May 04 03:32:18 u22942380 dockerd[19422]: time="2021-05-04T03:32:18.524814050-04:00" level=warning
May 04 03:32:18 u22942380 dockerd[19422]: time="2021-05-04T03:32:18.524838111-04:00" level=warning 
May 04 03:32:18 u22942380 dockerd[19422]: time="2021-05-04T03:32:18.524861059-04:00" level=warning 
May 04 03:32:18 u22942380 dockerd[19422]: time="2021-05-04T03:32:18.525730653-04:00" level=info msg
May 04 03:32:19 u22942380 dockerd[19422]: time="2021-05-04T03:32:19.747436391-04:00" level=info msg
May 04 03:32:20 u22942380 dockerd[19422]: time="2021-05-04T03:32:20.184183443-04:00" level=info msg
May 04 03:32:20 u22942380 dockerd[19422]: time="2021-05-04T03:32:20.397696657-04:00" level=info msg
May 04 03:32:20 u22942380 dockerd[19422]: time="2021-05-04T03:32:20.405438645-04:00" level=info msg
May 04 03:32:20 u22942380 dockerd[19422]: time="2021-05-04T03:32:20.511263047-04:00" level=info msg
May 04 03:32:20 u22942380 systemd[1]: Started Docker Application Container Engine.

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              62d49f9bab67        2 weeks ago         133MB
 /var/www/htmlroot@u22942380:/var/www/html# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
c24522a85ec0        nginx               "/docker-entrypoint.…"   3 minutes ago       Up 3 minutes        80/tcp              strange_yonath
# docker run -it centos /bin/bash
Unable to find image 'centos:latest' locally
latest: Pulling from library/centos

[1A[2K7a0437f04f83: Pulling fs layer [1B[1A[2K7a0437f04f83: 
Status: Downloaded newer image for centos:latest
...
Continues ...
...
# hostname
dad7c57e2199
# uname -a
Linux dad7c57e2199 5.4.0-67-generic #75~18.04.1-Ubuntu SMP Tue Feb 23 19:17:50 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
# ps -efa
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 07:33 pts/0    00:00:00 /bin/bash
root        17     1  0 07:33 pts/0    00:00:00 ps -efa
]0;@dad7c57e2199:/[root@dad7c57e2199 /]# df -h
Filesystem            Size  Used Avail Use% Mounted on
overlay                55G  3.9G   48G   8% /
tmpfs                  64M     0   64M   0% /dev
tmpfs                 7.9G     0  7.9G   0% /sys/fs/cgroup
shm                    64M     0   64M   0% /dev/shm
/dev/mapper/vg00-var   55G  3.9G   48G   8% /etc/hosts
tmpfs                 7.9G     0  7.9G   0% /proc/acpi
tmpfs                 7.9G     0  7.9G   0% /proc/scsi
tmpfs                 7.9G     0  7.9G   0% /sys/firmware
# cal
      May 2021      
Su Mo Tu We Th Fr Sa
                   1
 2  3 [7m 4[27m  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31               

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              62d49f9bab67        2 weeks ago         133MB
centos              latest              300e315adb2f        4 months ago        209MB
# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
dad7c57e2199        centos              "/bin/bash"              46 seconds ago      Up 41 seconds                           happy_wilbur
c24522a85ec0        nginx               "/docker-entrypoint.…"   5 minutes ago       Up 5 minutes        80/tcp              strange_yonath

NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"

Linux dad7c57e2199 5.4.0-67-generic #75~18.04.1-Ubuntu SMP Tue Feb 23 19:17:50 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Linux
# docker exec -it dad7 uname m
x86_64
# docker exec -it dad7 uname -r
5.4.0-67-generic
# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
dad7c57e2199        centos              "/bin/bash"              2 minutes ago       Up About a minute                       happy_wilbur
c24522a85ec0        nginx               "/docker-entrypoint.…"   6 minutes ago       Up 6 minutes        80/tcp              strange_yonath

Will stop the containers and remove them next
 /var/www/htmlroot@u22942380:/var/www/html# echo " [KI do not need them, just was a simple test"
I do not need them, just was a simple test
# docker stop dad c24
dad
c24

dad
c24
# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              62d49f9bab67        2 weeks ago         133MB
centos              latest              300e315adb2f        4 months ago        209MB
# echo "Now the containers are removed, I will remove the images"
Now the containers are removed, I will remove the images

Untagged: nginx:latest
Untagged: nginx@sha256:75a55d33ecc73c2a242450a9f1cc858499d468f077ea942867e662c247b5e412
Deleted: sha256:62d49f9bab67f7c70ac3395855bf01389eb3175b374e621f6f191bf31b54cd5b
Deleted: sha256:3444fb58dc9e8338f6da71c1040e8ff532f25fab497312f95dcee0f756788a84
Deleted: sha256:f85cfdc7ca97d8856cd4fa916053084e2e31c7e53ed169577cef5cb1b8169ccb
Deleted: sha256:704bf100d7f16255a2bc92e925f7007eef0bd3947af4b860a38aaffc3f992eae
Deleted: sha256:d5955c2e658d1432abb023d7d6d1128b0aa12481b976de7cbde4c7a31310f29b
Deleted: sha256:11126fda59f7f4bf9bf08b9d24c9ea45a1194f3d61ae2a96af744c97eae71cbf
Deleted: sha256:7e718b9c0c8c2e6420fe9c4d1d551088e314fe923dce4b2caf75891d82fb227d
Untagged: centos:latest
Untagged: centos@sha256:5528e8b1b1719d34604c87e11dcd1c0a20bedf46e83b5632cdeac91b8c04efc1
Deleted: sha256:300e315adb2f96afe5f0b2780b87f28ae95231fe3bdd1e16b9ba606307728f55
Deleted: sha256:2653d992f4ef2bfd27f94db643815aa567240c37732cae1405ad1c1309ee9859

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
# echo "All the images are also cleaned up"
All the images are also cleaned up
# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
b030abf5fdff        bridge              bridge              local
3cca29eeefe3        host                host                local
00d911a73b54        none                null                local
# systemctl status docker
docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
   Active: inactive (dead) since Tue 2021-05-04 03:37:36 EDT; 5s ago
     Docs: https://docs.docker.com
  Process: 19422 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (c
 Main PID: 19422 (code=exited, status=0/SUCCESS)

May 04 03:32:20 u22942380 dockerd[19422]: time="2021-05-04T03:32:20.184183443-04:00" level=info msg
May 04 03:32:20 u22942380 dockerd[19422]: time="2021-05-04T03:32:20.397696657-04:00" level=info msg
May 04 03:32:20 u22942380 dockerd[19422]: time="2021-05-04T03:32:20.405438645-04:00" level=info msg
May 04 03:32:20 u22942380 dockerd[19422]: time="2021-05-04T03:32:20.511263047-04:00" level=info msg
May 04 03:32:20 u22942380 systemd[1]: Started Docker Application Container Engine.
May 04 03:37:36 u22942380 systemd[1]: Stopping Docker Application Container Engine...
May 04 03:37:36 u22942380 dockerd[19422]: time="2021-05-04T03:37:36.953514056-04:00" level=info msg
May 04 03:37:36 u22942380 dockerd[19422]: time="2021-05-04T03:37:36.954729357-04:00" level=info msg
May 04 03:37:36 u22942380 dockerd[19422]: time="2021-05-04T03:37:36.955339946-04:00" level=info msg
May 04 03:37:36 u22942380 systemd[1]: Stopped Docker Application Container Engine.

Please click on " man docker " to see the Manual Page for this command.

Please click on " docker in PDF " format.