An error occurred while working with the docker container: there is no space on the device: "/ data / db / journal"

Running containers forms docker layout on Mac, this is a file

api: build: . volumes: - .:/src - /src/node_modules links: - mongo - redis ports: - "3015:3015" - "5858:5858" mongo: image: mongo:3.3 ports: - "27017:27017" redis: image: redis ports: - "6379:6379" 

The launch of the mongo container docker fails and fails. this is the log file:

 MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=7115a6cce706 db version v3.3.14 git version: 507a5b4d334c1b4bea8fa232fa6b882849608e97 OpenSSL version: OpenSSL 1.0.1t 3 May 2016 allocator: tcmalloc modules: none build environment: distmod: debian81 distarch: x86_64 target_arch: x86_64 options: {} ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine See http://dochub.mongodb.org/core/prodnotes-filesystem error creating journal dir /data/db/journal boost::filesystem::create_directory: No space left on device: "/data/db/journal" exception in initAndListen std::exception: boost::filesystem::create_directory: No space left on device: "/data/db/journal", terminating shutdown: going to close listening sockets... removing socket file: /tmp/mongodb-27017.sock shutdown: going to flush diaglog... now exiting shutting down with code:100 

The main complaints about the lack of free space for creating a directory, but I can not understand how to fix it.

+11
source share
4 answers

I fixed the problem of cleaning old volumes with the following command:

 $ docker volume rm $(docker volume ls -qf dangling=true) 

Link: docker-cleanup-volume

Update: 07/13/2008

Docker now has a built-in command to remove hanging volumes: docker volume prune .

+31
source

The dockerfile for the mongo image shows that the /data/db path uses docker volume:

 VOLUME /data/db /data/configdb 

If you run:

 docker inspect --format '{{ .Mounts }}' <your-container> 

This will tell you where the amount of data is mapped on your Mac. If it maps to a low-space disk, you can run a container pointing to another location that has a space:

 docker run -d -v <local-path-with-free-space>:/data/db mongo:3.3 

Or add this to your Compose file:

 volumes: - <local-path-with-free-space>:/data/db 
+2
source

I struggled with this problem on Windows, and no amount of shrinking, deleting or cleaning helped.

I had to use the option Whale> Settings> Reset> "Reset to factory default" ... , which ultimately fixed it.

0
source

I fixed the error by resizing the docker disk:

enter image description here

0
source

All Articles