• Docker
    • ➟ Introduction

Repository hosting publicly available Docker images:

https://hub.docker.com/explore

  • Docker
    • ➟ Introduction
      • ➟ Managing images
> 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
...
> 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
> 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
Image layer 1
Image layer 2
Image layer 3
Image layer 4
Image layer 5
Image layer 6
Image layer 7
> docker image inspect dac77467ddcc
[
    {
        "Id": "sha256:dac77467ddccc2287d99558245bd34707...",
        "RepoTags": [
            "nextcloud:13.0.4"
        ],
        "RepoDigests": [
            "nextcloud@sha256:fb3e77f19b21364925e8f02..."
        ],
 ...
> 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"
> 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
> 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
> docker image pull nextcloud
Using default tag: latest
latest: Pulling from library/nextcloud 
Digest: sha256:fb3e77f19b21364925e8f02d6e5ad3a1 ... 
Status: Downloaded newer image for nextcloud:latest
> 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
...
<dependency>
  <groupId>junit</groupId>           <!-- wonderfall -->
  <artifactId>junit</artifactId>     <!-- nextcloud -->
  <version>4.12</version>            <!-- 13.0.4 -->
</dependency>
> 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
...
> docker image rm nextcloud:13.0.2
Untagged: nextcloud:latest
Untagged: nextcloud@sha256:c693921e69cb89cd0bee7c014280159df647e5ba87f54c895650156d973df035
Deleted: sha256:10ae267ddcf25bfe5cc059685d3d005bcfe7229b44c3a6f93e0a07795d33b5b2
Deleted: sha256:1c271f4f2f19a222cd116c771b02294c5dd596fa8a0366559061f83a0de8de3f
...
Deleted: sha256:2c833f307fd8f18a378b71d3c43c575fabdb88955a2198662938ac2a08a99928
  • Docker
    • ➟ Introduction
      • ➟ Running container
> docker run -d -p 8080:80 --name nc13 nextcloud
517e3dba488763eb615f2c68d417e1b7fb3a9ce5bb4a5ffc346dcb86c00d13d2
> docker ps -a  # show stopped containers as well
CONTAINER ID  IMAGE      COMMAND                ... PORTS                 NAMES
517e3dba4887  nextcloud  "/entrypoint.sh apac…" ... 0.0.0.0:8080->80/tcp  nc13
> docker exec -it nextcloud_db_1 /bin/bash
# ls -al
total 84
drwxr-xr-x   1 root root 4096 Jun 20 09:28 .
drwxr-xr-x   1 root root 4096 Jun 20 09:28 ..
-rwxr-xr-x   1 root root    0 Jun 20 09:28 .dockerenv
drwxr-xr-x   1 root root 4096 May 25 20:20 bin
drwxr-xr-x   2 root root 4096 Nov 19  2017 boot
drwxr-xr-x   5 root root  340 Jun 20 09:28 dev
drwxr-xr-x   2 root root 4096 Apr 30 15:37 docker-entrypoint-initdb.d
lrwxrwxrwx   1 root root   34 May 25 20:20 docker-entrypoint.sh -> usr/local/bin/docker-entrypoint.sh
...
> docker rm nc13
nc13
> docker ps -a
CONTAINER ID   IMAGE       COMMAND             CREATED      STATUS                   ... NAMES
  • Docker
    • ➟ Introduction
      • ➟ Volumes
> docker volume ls
DRIVER              VOLUME NAME
local               nextcloud_db
local               nextcloud_nextcloud
# ls -al /var/lib/docker/volumes
total 40
drwx------  4 root root  4096 Jun 20 11:13 .
drwx--x--x 14 root root  4096 Jun 20 09:40 ..
-rw-------  1 root root 32768 Jun 20 11:13 metadata.db
drwxr-xr-x  3 root root  4096 Jun 20 11:13 nextcloud_db
drwxr-xr-x  3 root root  4096 Jun 20 11:13 nextcloud_nextcloud
> docker volume ls -f dangling=true
DRIVER              VOLUME NAME
local               nextcloud_db
local               nextcloud_nextcloud
> docker volume rm nextcloud_db nextcloud_nextcloud
nextcloud_db
nextcloud_nextcloud
  1. Airlines, airports and flights
  2. Creating a Hibernate JPA project
  3. Adding keys and AUTO_INCREMENT
  4. Advocating simple key definitions