Tuesday, 24 October 2017

THE LINUX STUFF: Docker Commands Sheet

THE LINUX STUFF: Docker Commands Sheet: sai-HP ~ # docker version Client:  Version:      1.10.2  API version:  1.22  Go version:   go1.5.3  Git commit:   c3959b1  Built:        Mo...

Docker Commands Sheet

sai-HP ~ # docker version
Client:
 Version:      1.10.2
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   c3959b1
 Built:        Mon Feb 22 21:37:01 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.10.2
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   c3959b1
 Built:        Mon Feb 22 21:37:01 2016
 OS/Arch:      linux/amd64

sai-HP ~ # docker info

Containers: 4
 Running: 0
 Paused: 0
 Stopped: 4
Images: 4
Server Version: 1.10.2
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 32
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Plugins:
 Volume: local
 Network: host bridge null
Kernel Version: 3.16.0-38-generic
Operating System: Ubuntu 14.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.72 GiB
Name: sai-HP
ID: 2PFW:N3WN:2X7R:KNT2:533T:FXFB:ZEZQ:IEK6:EB4A:AVOF:HAWE:ZVVO
WARNING: No swap limit support
sai-HP ~ #


sai-HP ~ # docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu              latest              ccc7a11d65b1        10 weeks ago        120.1 MB
<none>              <none>              e17b56e5200a        20 months ago       188 MB
hello-world         latest              690ed74de00f        2 years ago         960 B
training/webapp     latest              6fae60ef3446        2 years ago         348.8 MB


sai-HP ~ # docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

sai-HP ~ # docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                          PORTS               NAMES
27575d580ce7        e17b56e5200a        "bash"                   19 months ago       Exited (0) About a minute ago                       hungry_almeida
c19b41e0ab1f        e17b56e5200a        "cat /etc/debian_vers"   19 months ago       Exited (0) 19 months ago                            pupserver
a869a313280b        e17b56e5200a        "bash"                   20 months ago       Exited (0) 20 months ago                            agitated_payne
48240eb989f0        hello-world         "/hello"                 20 months ago       Exited (0) 20 months ago                            goofy_colden


sai-HP ~ # docker images -q
ccc7a11d65b1
e17b56e5200a
690ed74de00f
6fae60ef3446


sai-HP ~ # docker top  27575d580ce7
Error response from daemon: Container 27575d580ce7 is not running

sai-HP ~ # docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

sai-HP ~ # docker start 27575d580ce7
27575d580ce7

sai-HP ~ # docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
27575d580ce7        e17b56e5200a        "bash"              19 months ago       Up 4 seconds                            hungry_almeida

sai-HP ~ # docker top  27575d580ce7
UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD
root                5370                1857                0                   16:12               pts/7               00:00:00            bash
sai-HP ~ #

sai-HP ~ # docker stop  27575d580ce7
27575d580ce7

sai-HP ~ # docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

sai-HP ~ # docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS               NAMES
27575d580ce7        e17b56e5200a        "bash"                   19 months ago       Exited (0) 16 seconds ago                       hungry_almeida
c19b41e0ab1f        e17b56e5200a        "cat /etc/debian_vers"   19 months ago       Exited (0) 19 months ago                        pupserver
a869a313280b        e17b56e5200a        "bash"                   20 months ago       Exited (0) 20 months ago                        agitated_payne
48240eb989f0        hello-world         "/hello"                 20 months ago       Exited (0) 20 months ago                        goofy_colden


sai-HP ~ # docker rm  27575d580ce7
27575d580ce7

sai-HP ~ # docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                     PORTS               NAMES
c19b41e0ab1f        e17b56e5200a        "cat /etc/debian_vers"   19 months ago       Exited (0) 19 months ago                       pupserver
a869a313280b        e17b56e5200a        "bash"                   20 months ago       Exited (0) 20 months ago                       agitated_payne
48240eb989f0        hello-world         "/hello"                 20 months ago       Exited (0) 20 months ago                       goofy_colden

sai-HP ~ #