Managing images

Figure 1092. Search images Slide presentation
> docker search nextcloud
NAME                       DESCRIPTION      STARS  OFFICIAL   AUTOMATED
nextcloud                  A safe home …    424    [OK]
linuxserver/nextcloud      A Nextcloud …    56
greyltc/nextcloud          Nextcloud: …     34                [OK]
wonderfall/nextcloud       All-in-one …     27                [OK]
rootlogin/nextcloud        Nextcloud …      17                [OK]
lsioarmhf/nextcloud        ARMHF based …    8
ownyourbits/nextcloudpi    NextCloud ARM …  7
...

Figure 1093. Pull image using CLI Slide presentation
> docker image pull alpine
Using default tag: latest
latest: Pulling from library/alpine
ff3a5c916c92: Pull complete
Digest: sha256:7df6db5aa61ae9480f52f0b3a06a140ab98d427f86d8d5de0bedab9b8df6b1c0
Status: Downloaded newer image for alpine:latest

Figure 1094. Pull Nextcloud image Slide presentation
> docker image pull wonderfall/nextcloud 
Using default tag: latest 
latest: Pulling from wonderfall/nextcloud
ff3a5c916c92: Already exists 
a542d4c3cffb: Pull complete 
83001cc0bea0: Pull complete
41a33c66b2c1: Pull complete
a70bf67726f3: Pull complete
fea90b3d29ac: Pull complete
Digest: sha256:472c5c7...2ca20cca45 
Status: Downloaded newer image for wonderfall/nextcloud:latest

Get docker image from remote server.

Version defaults to «latest»: Subject to be overridden.

Reference to existing «alpine» layer.

Layer downloads.

Hash value allowing for image verification.

Figure 1095. Nextcloud based on Alpine Slide presentation

Figure 1096. Inspect image Slide presentation
> docker image inspect dac77467ddcc
[
    {
        "Id": "sha256:dac77467ddccc2287d99558245bd34707...",
        "RepoTags": [
            "nextcloud:13.0.4"
        ],
        "RepoDigests": [
            "nextcloud@sha256:fb3e77f19b21364925e8f02..."
        ],
 ...

Figure 1097. Search an image's tags Slide presentation
> curl 'https://registry.hub.docker.com/v2/repositories/library/nextcloud/tags/'|\
      jq '."results"[]["name"]'  # requires «aptitude install curl jq»
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11856    0 11856    0     0  11856      0 --:--:-- --:--:-- --:--:-- 20371
"fpm"
"production"
"stable"
"latest"
"13"
"13.0"
"13.0.2"
"production-apache"
"stable-apache"
"apache"

Figure 1098. Nextcloud image by version Slide presentation
> docker image pull nextcloud:13.0.4
13.0.4: Pulling from library/nextcloud
3d77ce4481b1: Pull complete
32bfdb6043a8: Pull complete
028453741593: Pull complete
f93d7bd342a3: Pull complete
4a2fac611953: Pull complete
87fdfc7d0f94: Pull complete
Digest: sha256:fb3e77f19b21364925e8f02d6e5ad3a1 ...
Status: Downloaded newer image for nextcloud:13.0.4

Figure 1099. List images by CLI Slide presentation
> docker image ls
REPOSITORY            TAG      IMAGE ID       CREATED        SIZE
nextcloud             13.0.4   dac77467ddcc   3 days ago     544MB
wonderfall/nextcloud  latest   57e1fb51b334   2 months ago   328MB
alpine                latest   3fd9065eaf02   4 months ago   4.15MB

Figure 1100. Nextcloud latest image Slide presentation
> docker image pull nextcloud
Using default tag: latest
latest: Pulling from library/nextcloud 
Digest: sha256:fb3e77f19b21364925e8f02d6e5ad3a1 ... 
Status: Downloaded newer image for nextcloud:latest

No «Pull complete» messages, image is alias of nextcloud:13.0.4.

Digest value identical to Figure 1098, “Nextcloud image by version ”.

Figure 1101. Duplicate Nextcloud images Slide presentation
> docker image ls 
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nextcloud           13.0.4              dac77467ddcc        4 days ago          544MB
nextcloud           latest              dac77467ddcc        4 days ago          544MB
...

Figure 1102. Maven ringing a bell? Slide presentation
<dependency>
  <groupId>junit</groupId>           <!-- wonderfall -->
  <artifactId>junit</artifactId>     <!-- nextcloud -->
  <version>4.12</version>            <!-- 13.0.4 -->
</dependency>

Figure 1103. Un tag image by version Slide presentation
> docker image rm nextcloud:latest
Untagged: nextcloud:latest

> docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nextcloud           13.0.4              dac77467ddcc        4 days ago          544MB
...

Figure 1104. Remove image by version Slide presentation
> docker image rm nextcloud:13.0.2
Untagged: nextcloud:latest
Untagged: nextcloud@sha256:c693921e69cb89cd0bee7c014280159df647e5ba87f54c895650156d973df035
Deleted: sha256:10ae267ddcf25bfe5cc059685d3d005bcfe7229b44c3a6f93e0a07795d33b5b2
Deleted: sha256:1c271f4f2f19a222cd116c771b02294c5dd596fa8a0366559061f83a0de8de3f
...
Deleted: sha256:2c833f307fd8f18a378b71d3c43c575fabdb88955a2198662938ac2a08a99928