简体   繁体   English

如何在 Ubuntu CLI 中设置 Docker 磁盘大小?

[英]How do I set the Docker disk size in Ubuntu CLI?

Docker taking space - image here Docker 占用空间 - 图片在这里

Is their way to set the Docker Disk Image size been used using CLI?他们设置 Docker 磁盘映像大小的方法是否已使用 CLI?

Yes there is, You can create a volume and attach it to your container.是的,您可以创建一个卷并将其附加到您的容器中。 As in docker documentation you can create volume like this在 docker 文档中,您可以像这样创建卷

docker volume create --driver local \
--opt type=tmpfs \
--opt device=tmpfs \
--opt o=size=100m,uid=1000 \
foo

And attach it to you container using the -v option on docker run command并使用 docker 运行命令上的 -v 选项将其附加到您的容器

docker run -d -v foo:/world busybox

you can find a description for each option in the docker documentation it's a one of the greatest reference you could find https://docs.docker.com/engine/reference/commandline/volume_create/您可以在docker文档中找到每个选项的描述,这是您可以找到的最重要的参考之一

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM