1

Docker version 18.03.1-ce, build 9ee9f40

I am trying to increase the docker container sizing on Ubuntu 16.04.

I have created the following file at /etc/docker/daemon.json

{
    "storage-opts": ["dm.basesize=20G"]
}

However when I sudo service docker start I get: Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

If I remove /etc/docker/daemon.json then docker can start.

Inspecting the recommended logs yields

systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Sat 2018-05-05 12:58:26 PDT; 4min 35s ago
     Docs: https://docs.docker.com
  Process: 3047 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 3047 (code=exited, status=1/FAILURE)

May 05 12:58:26 stage systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
May 05 12:58:26 stage systemd[1]: Failed to start Docker Application Container Engine.
May 05 12:58:26 stage systemd[1]: docker.service: Unit entered failed state.
May 05 12:58:26 stage systemd[1]: docker.service: Failed with result 'exit-code'.
May 05 12:58:26 stage systemd[1]: docker.service: Service hold-off time over, scheduling restart.
May 05 12:58:26 stage systemd[1]: Stopped Docker Application Container Engine.
May 05 12:58:26 stage systemd[1]: docker.service: Start request repeated too quickly.
May 05 12:58:26 stage systemd[1]: Failed to start Docker Application Container Engine.

journalctl -xe
--
-- Unit docker.socket has begun starting up.
May 05 12:58:26 stage systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has finished starting up.
--
-- The start-up result is done.
May 05 12:58:26 stage systemd[1]: docker.service: Start request repeated too quickly.
May 05 12:58:26 stage systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
May 05 12:58:26 stage systemd[1]: docker.socket: Unit entered failed state.
May 05 13:01:16 stage sudo[3069]:      mjb : TTY=pts/0 ; PWD=/var/www/app ; USER=root ; COMMAND=/bin/cat /etc/docker/daemon.json
May 05 13:01:16 stage sudo[3069]: pam_unix(sudo:session): session opened for user root by mjb(uid=0)
May 05 13:01:16 stage sudo[3069]: pam_unix(sudo:session): session closed for user root

How can I increase the default dm.basesize of Docker on Ubuntu such that, when I start docker using the command sudo service docker start it starts and has an increased dm.basesize?

1

You can try below /etc/docker/daemon.json

{
    "experimental" : true,
    "storage-driver" : "devicemapper",
    "storage-opts" : ["dm.basesize=20G"]
}

Then try :

systemctl daemon-reload
systemctl restart docker
  • 2
    That defaults to a loop file which is not recommended for production. I wouldn't recommend device mapper for any new docker deployment, overlay2 is the preferred storage driver for 4.x kernels and current docker releases. – BMitch May 9 '18 at 12:51
  • @BMitch it would be super helpful if you could provide the info in order to use overlay2 with an increased basesize. I find it challenging to find the precise semantics required in the daemon.json file to produce this result, hence posting the question here. If your solution is better, I think I can change the answer which is marked correct. – Matthew James Briggs May 10 '18 at 18:35
  • 2
    @MatthewJamesBriggs there is no base size limit with other storage drivers. The limitation and option to adjust that limit only exist with device mapper. Other storage drivers let you use as much of the disk as you need and only allocate what you use, instead of allocating fixed sized chunks in advance. – BMitch May 10 '18 at 18:45
2

The only log message there is "Start request repeated too quickly." so we're missing the beginning of the error. You can run as root systemctl reset-failed and then systemctl start docker followed by journalctl -u docker --no-pager -n 50 to show the last 50 lines of logs.

Most likely, your problem is that your storage driver is not device mapper, and this option only applies to device mapper. On an 18.03 install, ubuntu will be overlay2 with a recent enough kernel, or possibly aufs on older kernels. Without using the device mapper storage driver, you should not be setting that option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.