<p>You can try below /etc/docker/daemon.json </p>

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

<p>Then try :</p>

<pre><code>systemctl daemon-reload
systemctl restart docker
</code></pre>

CC BY-SA 4.0
2018-05-09T12:51:27.263Z
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
CC BY-SA 4.0
2018-05-10T18:35:34.370Z
@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
CC BY-SA 4.0
2018-05-10T18:45:58.907Z
@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
CC BY-SA 4.0
2018-05-09T04:27:19.843Z
2018-05-09T04:27:19.843Z
Aditya Pawaskar
<p>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 <code>systemctl reset-failed</code> and then <code>systemctl start docker</code> followed by <code>journalctl -u docker --no-pager -n 50</code> to show the last 50 lines of logs.</p>

<p>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.</p>

CC BY-SA 4.0
2018-05-07T18:40:35.173Z
2018-05-07T18:40:35.173Z
BMitch
<p><code>Docker version 18.03.1-ce, build 9ee9f40</code></p>

<p>I am trying to increase the docker container sizing on Ubuntu 16.04.</p>

<p>I have created the following file at <code>/etc/docker/daemon.json</code></p>

<pre><code>{
    "storage-opts": ["dm.basesize=20G"]
}
</code></pre>

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

<p>If I remove <code>/etc/docker/daemon.json</code> then docker can start.</p>

<p>Inspecting the recommended logs yields</p>

<pre><code>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
</code></pre>

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

<docker>
Cannot Change Docker Size on Ubuntu 16.04
Matthew James Briggs
# Cannot Change Docker Size on Ubuntu 16.04

(Asked by: username_0 on 2018-05-05)

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?

**Tags:** docker


---

## 2 answers

### Answer by username_1 on 2018-05-09. Score: 1 | Accepted answer

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

> **Comments:**
> **username_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.  
> **username_0**: @username_2 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.  
> **username_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.  

---

### Answer by username_2 on 2018-05-07. Score: 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.


---

