如何增加Docker容器的默认大小? [英] How to increase Docker container default size?
问题描述
我们已经创建了默认大小为10GB的docker映像,并且已经加载了cassandra数据,因为它已满,意味着没有空间。谁能说出如何在不丢失现有数据的情况下将Docker容器大小从10GB增加到40GB。
We have created docker image with default size of 10GB and we have loaded cassandra data now it is full means there is no space. Can anyone tell how to increase the docker container size to 40GB from 10GB without loss of existing data.
推荐答案
我认为不可能(在不丢失数据的情况下)。这是您扩大基本大小的方法:
I don't think it is possible (without the losing of the data). Here is how you enlarge the basesize:
-
(可选)如果已下载任何图像通过
docker pull
您需要先清理它们-否则它们将无法调整大小
(optional) If you have already downloaded any image via
docker pull
you need to clean them first - otherwise they won't be resized
docker rmi your_image_name
编辑存储配置
vi / etc / sysconfig / docker-storage
应该类似于 DOCKER_STORAGE_OPTIONS =。 .. ,将其更改为
DOCKER_STORAGE_OPTIONS = ... --storage-opt dm.basesize = 100G
There should be something like DOCKER_STORAGE_OPTIONS="..."
, change it to DOCKER_STORAGE_OPTIONS="... --storage-opt dm.basesize=100G"
重启docker守护进程
Restart the docker deamon
服务docker restart
拉镜像
docker pull your_image_name
(可选)验证
docker运行-i -t your_image_name / bin / bash
df -h
我为此付出了很多努力我找到了此链接 http://www.projectatomic.io/blog/2016 / 03 / daemon_option_basedevicesize /
原来,您必须在扩大基本大小之后删除/拉动图像。
I was struggling with this a lot until I found out this link http://www.projectatomic.io/blog/2016/03/daemon_option_basedevicesize/ turns out you have to remove/pull image after enlarging the basesize.
这篇关于如何增加Docker容器的默认大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!