Docker Machine:设备上没有剩余空间 [英] Docker Machine: No space left on device

查看:81
本文介绍了Docker Machine:设备上没有剩余空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Docker Compose设置Docker Machine。

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

方案1(无Docker Machine)

如果我在没有Docker Machine的情况下运行 docker-compose up -d ,它将按意图创建我的3个链接容器(nginx + mongodb + nodejs)。

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).

场景2(使用Docker计算机)

然后,我使用Docker Machine创建VM,并告诉Docker使用<$ c与该计算机对话$ c> eval $(docker-machine env streambacker-dev)。

在这一点上,如果我使用shsh进入docker计算机并运行 df -h ,我得到:

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

如果我然后运行 docker-compose up -d ,下载最后一个容器时,出现设备上没有剩余空间错误

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

tmpfs之后似乎确实有点满了:

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

检查-virtualbox-disk-size 选项显示其默认设置到20000 MB,我认为这是我们在两张图片上都可以看到的 / dev / sda1。那么,为什么容器会填充 tmpfs n,而 tmpfs到底是什么呢?是一个临时下载目录吗? 如何为容器创建更多空间?

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?

谢谢!

对于信息,我正在使用 Docker Machine 0.4.0-rc2 Docker Compose 1.3.2

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

推荐答案

就像上面说的, tmpfs --virtualbox-disk-size 。似乎boot2docker将 tmpfs 装入内存,因此您需要为virtualbox vm分配更多的内存。您可以通过指定-virtualbox-memory 参数来实现。

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]

默认值:

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

使用-virtualbox -内存设置为 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% /

这篇关于Docker Machine:设备上没有剩余空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆