dockerdocker-composedocker-machine

Docker Machine: No space left on device


I'm trying to set up Docker Machine with Docker Compose.

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

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

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

docker machine df -h

If I then run docker-compose up -d, I get a "no space left on device" error while downloading the last container.

"tmpfs" seems to be indeed a bit full after that:

docker machine df -h

Checking the --virtualbox-disk-size option shows that it defaults to 20000 MB, which I think is what we can see as "/dev/sda1" on both pictures. So why are containers filling up "tmpfs" n and what exactly is "tmpfs"? Is is a temporary download directory? How can I create more space for my containers?

Thanks!

For information, I'm using Docker Machine 0.4.0-rc2 and Docker Compose 1.3.2.


Solution

  • Like said above, the tmpfs has nothing to do with --virtualbox-disk-size. It seems like boot2docker mounts tmpfs into memory, so you need to dedicate more memory to your virtualbox vm. You can do it by specifying the --virtualbox-memory parameter.

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

    Defaults:

    $ 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% /