Ubuntu – Cannot install docker on Ubuntu 17.10

dockerUbuntu

I have :
Ubuntu 17.10 – kernel 4.13.0-19-generic

No docker on the machine

Installing docker as https://github.com/docker/docker-install, ie :

curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh

I get

$ docker -v
Docker version 17.11.0-ce, build 1caf76c

Nice, when I run $ sudo docked, I get

ERRO[2017-12-15T17:33:21.314578657+01:00] 'overlay' not found as a
supported filesystem on this host. Please ensure kernel is new enough
and has overlay support loaded.

ERRO[2017-12-15T17:33:21.316522224+01:00] 'overlay' not found as a
supported filesystem on this host. Please ensure kernel is new enough
and has overlay support loaded. Error starting daemon: error
initializing graphdriver: devicemapper:

Error running deviceCreate (CreatePool) dm_task_run failed

I try again, and get this time

ERRO[2017-12-15T17:35:24.814595903+01:00] [graphdriver] prior storage
driver devicemapper failed: devicemapper: Error running deviceCreate
(CreatePool) dm_task_run failed

Error starting daemon: error initializing graphdriver: devicemapper: Error running deviceCreate
(CreatePool) dm_task_run failed

What's wrong ?

Best Answer

I've installed a new VM with Ubuntu 17.10 in Virtualbox and I've updated the packages using apt.

Current kernel version:

$ uname -a
Linux test-VirtualBox 4.13.0-19-generic #22-Ubuntu SMP Mon Dec 4 11:58:07 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I install Docker using your suggested script:

apt-get install curl -y
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh

I add my user account to the docker group:

sudo usermod -aG docker test

I log out and log in again so my group membership is updated.

I check the docker CLI version:

docker version
Client:
 Version:      17.11.0-ce
 API version:  1.34
 Go version:   go1.8.5
 Git commit:   1caf76c
 Built:        Mon Nov 20 18:36:39 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.11.0-ce
 API version:  1.34 (minimum version 1.12)
 Go version:   go1.8.5
 Git commit:   1caf76c
 Built:        Mon Nov 20 18:35:09 2017
 OS/Arch:      linux/amd64
 Experimental: false

Docker 17.11 CE (edge) is installed.

I start the docker daemon and enable it:

$ sudo systemctl status docker
$ sudo systemctl enable docker

I check that the docker daemon is running well

$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2017-12-18 20:37:32 CET; 4min 35s ago
     Docs: https://docs.docker.com
 Main PID: 2028 (dockerd)
    Tasks: 18 (limit: 4915)
   Memory: 35.7M
      CPU: 2.641s
   CGroup: /system.slice/docker.service
           ├─2028 /usr/bin/dockerd -H fd://
           └─2033 docker-containerd --config /var/run/docker/containerd/containerd.toml

dic 18 20:37:29 test-VirtualBox dockerd[2028]: time="2017-12-18T20:37:29.670548640+01:00" level=warning msg="Your kernel does not support swap memory limit"
dic 18 20:37:29 test-VirtualBox dockerd[2028]: time="2017-12-18T20:37:29.674459227+01:00" level=warning msg="Your kernel does not support cgroup rt period"
dic 18 20:37:29 test-VirtualBox dockerd[2028]: time="2017-12-18T20:37:29.674701645+01:00" level=warning msg="Your kernel does not support cgroup rt runtime"
dic 18 20:37:29 test-VirtualBox dockerd[2028]: time="2017-12-18T20:37:29.680586963+01:00" level=info msg="Loading containers: start."
dic 18 20:37:30 test-VirtualBox dockerd[2028]: time="2017-12-18T20:37:30.678377763+01:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0
dic 18 20:37:31 test-VirtualBox dockerd[2028]: time="2017-12-18T20:37:31.543493214+01:00" level=info msg="Loading containers: done."
dic 18 20:37:31 test-VirtualBox dockerd[2028]: time="2017-12-18T20:37:31.869113420+01:00" level=info msg="Docker daemon" commit=1caf76c graphdriver(s)=overlay2 version=17
dic 18 20:37:31 test-VirtualBox dockerd[2028]: time="2017-12-18T20:37:31.873009943+01:00" level=info msg="Daemon has completed initialization"
dic 18 20:37:32 test-VirtualBox systemd[1]: Started Docker Application Container Engine.
dic 18 20:37:32 test-VirtualBox dockerd[2028]: time="2017-12-18T20:37:32.192666262+01:00" level=info msg="API listen on /var/run/docker.sock"

Docker daemon is using overlay2 as the storage driver.

$ docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 17.11.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs

Overlay module is loaded:

lsmod | grep overlay
overlay                69632  0

I've rebooted the server and checked that docker has started fine and I can start a hello-world container:

$ docker run hello-world
...
Hello from Docker!

Everything looks good! So I suggest you to start your docker daemon using systemctl instead of starting it using dockerd from the shell.