Docking machine: there is no space on the device

I am trying to configure Docker Machine using Docker Compose.

Scenario 1 (without docker machine)
If I run docker-compose up -d without the Docker Machine, it creates my 3 related containers as intentional (nginx + mongodb + nodejs).

Scenario 2 (with docker machine)
Then I create a virtual machine using the Docker Machine and tell Docker how to talk to this machine using eval $(docker-machine env streambacker-dev) .

At this point, if I ssh for my docker machine and run df -h , I get:

docker machine df -h

If I run docker-compose up -d , I get a "no space on device" error when loading the last container.

"tmpfs" seems really a bit complete after this:

docker machine df -h

Checking the parameter - virtualbox-disk <file size shows that it defaults to 20,000 MB, and I think this is what we can see as "/ dev / sda1" in both pictures. So why do containers fill in "tmpfs" n and what is "tmpfs"? Is a temporary download directory? How to create more space for containers?

Thank!

For information, I use Docker Machine 0.4.0-rc2 and Docker Compose 1.3.2.

+86
docker docker-compose docker-machine
Aug 09 '15 at 23:58
source share
5 answers

As stated above, tmpfs has nothing to do with --virtualbox-disk-size . Boot2docker seems to mount tmpfs in memory, so you need to allocate more memory for your virtual vm box. You can do this by specifying the --virtualbox-memory option.

  --virtualbox-memory "1024" Size of memory for host in MB [$VIRTUALBOX_MEMORY_SIZE] 

default:

 $ docker-machine create --driver virtualbox testA Creating VirtualBox VM... Creating SSH key... Starting VirtualBox VM... Starting VM... $ docker-machine ssh testA ## . ## ## ## == ## ## ## ## ## === /"""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\_______/ _ _ ____ _ _ | |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __ | '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__| | |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ | |_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_| Boot2Docker version 1.8.1, build master : 7f12e95 - Thu Aug 13 03:24:56 UTC 2015 Docker version 1.8.1, build d12ea79 docker@testA:~$ df -h / Filesystem Size Used Available Use% Mounted on tmpfs 896.6M 112.7M 783.9M 13% / 

With --virtualbox-memory set to 8096

 $ docker-machine create --driver virtualbox --virtualbox-memory 8096 testB Creating VirtualBox VM... Creating SSH key... Starting VirtualBox VM... Starting VM... $ docker-machine ssh testB ## . ## ## ## == ## ## ## ## ## === /"""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\_______/ _ _ ____ _ _ | |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __ | '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__| | |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ | |_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_| Boot2Docker version 1.8.1, build master : 7f12e95 - Thu Aug 13 03:24:56 UTC 2015 Docker version 1.8.1, build d12ea79 docker@testB:~$ df -h / Filesystem Size Used Available Use% Mounted on tmpfs 6.9G 112.4M 6.8G 2% / 
+68
Sep 11 '15 at 8:13
source share

I had the same error ( [ERROR] InnoDB: Error number 28 means 'No space left on device' ) and solved it as follows:

1. Delete lost volumes in Docker, you can use the built-in toner command. The built-in command also deletes any directory in / var / lib / docker / volumes that is not a volume, so make sure you do not put anything there that you want to keep.

Warning be very careful with this if you have data that you want to keep

Cleaning:

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

Additional commands:

List of dangling volumes:

 $ docker volume ls -qf dangling=true 

List of all volumes:

 $ docker volume ls 



2. Also consider deleting all unused images.

First get rid of the <none> images (they are sometimes generated when creating the image, and if for some reason the image building was interrupted, they remain there).

here is a good script i use to remove them

 docker rmi $(docker images | grep "^<none>" | awk "{print $3}") 

Then, if you use Docker Compose to create images locally for each project. You will end up with a lot of images, which are usually called your folder (for example, if your project folder is named Hello, you will find the image name Hello_blablabla ). therefore also consider deleting all these images

you can edit the above script to delete them or delete them manually with

docker rmi {image-name}

+71
May 19 '16 at 16:49
source share

If you are using the Docker Community Edition:

docker system removal

If you use boot2docker (docker-machine), clear those axes that are lost:

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

Delete unused images:

docker rmi $ (docker images -q -f "dangling = true")

+22
Feb 21 '17 at 15:08
source share

but. DELETE UNUSUAL IMAGES

using the docker rm or docker rmi commands, you can delete images that you don’t need. In fact, there is an image that helps in this task (martins / dockers-chips-toms). The basis is to run selectig from the list of your images and containers:

docker ps -a -s

B. EDIT DOCKER JSON DESCRIPTION

it is mentioned in some forums. The idea is to increase the handle located in ~ / .docker / machine / machines / default / config.json. DiskSize seems to be paired, but I don’t know if it works on other operating systems (not Windows).

C. LINUX RESIZE:

in Windows, the docker machine or boot2docker is actually a virtual vm box, then you can follow the procedure to resize the disk. Take care of backing up your files. The general procedure is to resize in a virtual box, and then use the gpartd utility to change the space perceived by linux in its partitions. There are several links for performing this procedure below:

D. RECREATE DOCKER-MACHINE / BOOT2DOCKER

The idea recreates a standard docker machine. The following commands can illustrate you. Please note that when you recreate boot2docker, you will lose the previous loaded docker images.

docker-machine rm default

docker-machine create --driver virtualbox --virtualbox-disk-size "100100" by default

docker-machine env default

then you can go into the virtual box and see the boot2docker space with the command "df -h"

+8
Jun 10 '16 at 20:09
source share

In docker osx / I managed to click the [ Move Disk Image ] button and it successfully moved Docker.qcow2 (presumably containing containers / images)

enter image description here at first - when the cars started - I was still getting There was no space left on the device error but it resolved shortly afterwards.

0
Sep 06 '17 at 22:41
source share



All Articles