REPOSITORY TAG IMAGE ID CREATED SIZE debian bookworm 0ce03c8a15ec 8 hours ago 117MB alpine 3.16 8471affe5de5 7 months ago 5.55MB
Untagged: debian:bookworm Untagged: debian@sha256:133a1f2aa9e55d1c93d0ae1aaa7b94fb141265d0ee3ea677175cdb96f5f990e5 Deleted: sha256:0ce03c8a15ec97f121b394857119e3e7652bba5a66845cbfa449d87a5251914e Deleted: sha256:7cea17427f83f6c4706c74f94fb6d7925b06ea9a0701234f1a9d43f6af11432a
Error response from daemon: conflict: unable to delete 0ce03c8a15ec (must be forced) - image is being used by stopped container 2cb71c235c6a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2cb71c235c6a 0ce03c8a15ec "bash" 8 minutes ago Exited (130) About a minute ago test
2cb71c235c6a
(gone)
Flag | Usage |
---|---|
-f --filter "key=value" |
filter output based on condition(s) provided |
-q --quiet | return image IDs only |
REPOSITORY TAG IMAGE ID CREATED SIZE foobar 2.14.13 8d184a936572 17 hours ago 283MB foobar 2.14.12 e116aecf034c 17 hours ago 283MB foobar 2.15.0 ee657cd3af27 17 hours ago 283MB foobar 2.16.2 5a9fb562f34b 25 hours ago 284MB debian bookworm-slim 971072c49252 13 days ago 74.8MB debian bookworm 0ce03c8a15ec 2 months ago 117MB vmware/powerclicore latest 9359cebc65e4 8 months ago 2.15GB alpine 3.16 8471affe5de5 10 months ago 5.55MB rockylinux 9.1 ce99dcf19c24 13 months ago 176MB alpine 3.15 c4fc93816858 17 months ago 5.59MB vmware/powerclicore 12.7 d2d244ad5d73 18 months ago 932MB nginx 1.19.9-alpine bfad9487e175 2 years ago 22.6MB
REPOSITORY TAG IMAGE ID CREATED SIZE foobar 2.14.13 8d184a936572 17 hours ago 283MB foobar 2.14.12 e116aecf034c 17 hours ago 283MB foobar 2.15.0 ee657cd3af27 17 hours ago 283MB foobar 2.16.2 5a9fb562f34b 25 hours ago 284MB
something—described by the part— with images
IMAGE CREATED CREATED BY SIZE c5ffa610ab8d About a minute ago |1 /bin/sh -c 614MB this was caused by the last RUN of my Dockerfile 155a3bf504ad 2 minutes ago |1 /bin/sh -c 52.9MB 2b54b499613b 2 minutes ago /bin/sh -c #(nop) LABEL comment=blah 0B e9716a3e46f8 2 minutes ago /bin/sh -c #(nop) ARG 0B 0ce03c8a15ec 3 days ago /bin/sh -c #(nop) CMD ["bash"] 0B <missing> 3 days ago /bin/sh -c #(nop) ADD file:39d17d2d62… 117MB
Flag | Usage |
---|---|
-a --all | show all containers (default shows just running) |
-q --quiet | only display container IDs |
Flag | Usage |
---|---|
-f path/to/myDockerfile --file=path/to/myDockerfile |
|
--rm | Remove intermediate containers after a successful build |
-t repo:tag --tag repo:tag |
Name and tag the resulting image in the repo:tag format |
Flag | corresponding Dockerfile directive | Usage |
---|---|---|
-d --detach |
In foreground mode (opposite of detached mode evoked above), docker run can start the process in the container and attach the console to the process's standard input, output, and standard error. It can even pretend to be a TTY (this is what most command line executables expect) and pass along signals. All of that is configurable with -i, -t
|
|
--entrypoint=someCommand | Overwrite the default entrypoint set by the image with someCommand | |
-i --interactive | interactive mode : keep STDIN open even if not attached | |
--name myContainer | assign a name to the container | |
-P --publish-all | Publish all EXPOSEd ports to the host interfaces. Docker binds each EXPOSEd port to a random port on the host. | |
-p=portSpecification | Publish a container's port/range of ports to the host. This allows mapping ports : hostPort:containerPort
Many syntaxes available, please
|
|
--rm (1, 2) | when the container exits, remove :
|
|
-t | Allocate a pseudo-tty | |
--user userSpecification | USER | username or UID, with userSpecification : name|uid[:group|gid] |
-v volumeSpecification --volume=volumeSpecification |
VOLUME | bind mount a volume using volumeSpecification : X:Y:Z
|
-w dir --workdir dir | WORKDIR | use dir as working directory inside the container |
Flag | Usage |
---|---|
-f formatString --format=formatString |
Format the output using the given Go template (details : 1, 2)
|
[ { "Id": "sha256:4000f524b3ffb2282cd02892b8f89ec886bda2f71d87096f14378a6043ef4fab", "DockerVersion": "18.03.1-ce", "Config": { "Hostname": "", "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
.DockerVersion
}}'18.03.1-ce
.Config.Env
}}[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]
.State
}}' containerId{running true false false false false 5654 0 2020-09-09T09:49:07.578164883Z 0001-01-01T00:00:00Z <nil>}
{"Status":"running", "Running":true, "Paused":false, "Restarting":false, "OOMKilled":false, "Dead":false, "Pid":5654, "ExitCode":0, "Error":"", "StartedAt":"2020-09-09T09:49:07.578164883Z", "FinishedAt":"0001-01-01T00:00:00Z"}
.State
}}' containerId{running true false false false false 5654 0 2020-09-09T09:49:07.578164883Z 0001-01-01T00:00:00Z <nil>}
{"Status":"running", "Running":true, "Paused":false, "Restarting":false, "OOMKilled":false, "Dead":false, "Pid":5654, "ExitCode":0, "Error":"", "StartedAt":"2020-09-09T09:49:07.578164883Z", "FinishedAt":"0001-01-01T00:00:00Z"}
{ "Dead": false, "Error": "", "ExitCode": 0, "FinishedAt": "0001-01-01T00:00:00Z", "OOMKilled": false, "Paused": false, "Pid": 5654, "Restarting": false, "Running": true, "StartedAt": "2020-09-09T09:49:07.578164883Z", "Status": "running" }
Flag | Usage |
---|---|
-i --interactive | Keep STDIN open even if not attached |
-t --tty | Allocate a pseudo-TTY |
-u --user | specify a username or UID |