KB Article #183112

Error docker load : no space left on device

Problem

Error no space left on device when executing commands:

  • docker load --input...
  • docker compose up -d

For instance:

# cd automator-services/
# docker load --input /automator/images413P3.tar
cb381a32b229: Loading layer [==================================================>] 5.88MB/5.88MB
722b3e7e5e08: Loading layer [==================================================>] 1.986MB/1.986MB
71dc164f262f: Loading layer [==================================================>] 178MB/178MB
856f7d1debc7: Loading layer [==================================================>] 1.037MB/1.037MB
c9507e62bd2b: Loading layer [==================================================>] 753.7kB/753.7kB
92bb4e7dc4e6: Loading layer [==================================================>] 609.8kB/609.8kB
bf9340cfa632: Loading layer [==================================================>] 4.096kB/4.096kB
2854c6fef850: Loading layer [==================================================>] 2.275MB/2.275MB
ab3aca324246: Loading layer [==================================================>] 4.55MB/4.55MB
6fcce0bf091b: Loading layer [==================================================>] 2.56kB/2.56kB
97d076ded63e: Loading layer [==================================================>] 230.1MB/230.1MB

ApplyLayer exit status 1 stdout: stderr: write /opt/jboss/keycloak-10.0.2.tar.gz: no space left on device


Resolution

Docker daemon persists all data in a single directory. This tracks everything related to Docker, including containers, images, volumes, service definition, and secrets. By default, on a Linux powered host this directory is: /var/lib/docker.
The reported error means that the file-system supporting /var/lib/docker is full.

To fix the problem, you have two possibilities:


  1. Delete volumes currently not in use by a running or stopped container.
    Use this command:
    docker system prune --all --force --volumes



  2. Best practice to ease that point, is to configure Docker daemon to use a different directory using the data-root configuration option.
    • Determine where docker data should be persisted
      For instance: /path/to/application/automator/docker-data
    • Stop Docker docker
      sudo systemctl stop docker
    • Update /etc/docker/daemon.json file
      {
      …,
      "data-root": "/path/to/application/automator/docker-data",
      "storage-driver": "overlay2",
      "log-driver": "local",
      "log-opts": {
      "max-size": "10m"
      }
      }
    • Move Docker data to the new location
      sudo rsync -aqxPS /var/lib/docker/ /path/to/application/automator/docker-data/
    • Restart docker and check Docker has started up using the new location
      sudo systemctl start docker
      $ docker info | grep 'Docker Root Dir'