如何收回一个停运的停泊码头容器? [英] How to recover a stopped docker container which ran out of space?

查看:344
本文介绍了如何收回一个停运的停泊码头容器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个docker容器达到了默认的10GB限制,现在我不能启动它了。这是我收到的错误:


守护进程的错误响应:无法启动容器dfc:setup mount
命名空间无法创建pivot_root dir,错误mkdir
/var/lib/docker/devicemapper/mnt/dfc2df0ba006762d44e13a3fe12b113a970ca7d91a530a8af1e82178d22f5608/rootfs/.pivot_root753727542:
设备上没有空间2015/01/12 15:32:58错误:未能开始一个
或更多容器


有一个 blog post 解释如何增加容器超过10GB限制的大小,但是它认为容器正在运行。在我的情况下,它被停止,我在/ dev / mapper中找不到正确的设备。



有没有办法增加容器大小,所以我可以恢复访问我的容器?

解决方案

这不是微不足道,但可能。我在RedHat7上做了一次。它可能不适用于旧版本的Centos / Redhat。



我在这个 post



基本上,您执行以下步骤:




  • 使用docker commit
  • $将容器另存为图像b $ b
  • 使用docker save将新的图像保存为磁盘上的tar文件

  • 重新配置每个容器的默认空间,如 post

  • 在上一步将会松开所有本地图像和容器,但是您已将图像作为tar文件保存在磁盘上。

  • 加载您以前保存的图像,使用码头加载

  • 使用docker运行


从刚刚加载的图像运行新容器

I've got a docker container that reached the default 10GB limit, and now I cannot start it anymore. This is the error I receive:

Error response from daemon: Cannot start container dfc: setup mount namespace can't create pivot_root dir , error mkdir /var/lib/docker/devicemapper/mnt/dfc2df0ba006762d44e13a3fe12b113a970ca7d91a530a8af1e82178d22f5608/rootfs/.pivot_root753727542: no space left on device 2015/01/12 15:32:58 Error: failed to start one or more containers

There's a blog post explaining how to increase the size of the container past the 10GB limit, but it seens to assume the container is running. In my case, It's stopped and I can't find the correct device in /dev/mapper.

Is there any way to increase the container size, so I can recover access to my container?

解决方案

It is not trivial but possible. I did it once on RedHat7. It will probably not work with older versions of Centos/Redhat.

I explained it in this post.

Basically, you perform these steps:

  • Save the container as an image, using docker commit
  • Save the new image as a tar file on disk, using docker save
  • Reconfigure the default space per container, as explained in this post
  • In the previous step will loose all local images and containers, but you have saved your image as a tar file on disk.
  • Load the image you previousley saved, using docker load
  • Run a new container from the just loaded image, using docker run

这篇关于如何收回一个停运的停泊码头容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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