Docker increase disk space

2019-02-09 16:19发布

I have a docker running and it gives me disk space warning. How can i increase the docker space and start again? (The same container)

Lets say I want to give like 15gb.

标签: docker
3条回答
叼着烟拽天下
2楼-- · 2019-02-09 16:24

I assume you are talking about disk space to run your containers.

Make sure that you have enough space on whatever disk drive you are using for /var/lib/docker which is the default used by Docker. You can change it with the -g daemon option.

If you don't have enough space you may have to repartition your OS drives so that you have over 15GB. If you are using boot2docker or docker-machine you will have to grow the volume on your Virtual Machine. It will vary depending on what you are using for Virtualization (i.e VirtualBox, VMware, etc)

For example if you are using VirtualBox and docker-machine you can start with something like this for a 40GB VM.

docker-machine create --driver virtualbox --virtualbox-disk-size "40000" default
查看更多
forever°为你锁心
3楼-- · 2019-02-09 16:25

To increase space available for Docker you will have to increase your docker-pool size. If you do a

lvs

You will see the docker-pool logical volume and its size. If your docker pool is sitting on a volume group that has free space you can simply increase the docker-pool LV by

lvextend -l 100%FREE <path_to_lv>
# An example using this may looks like this:
# lvextend -l 100%FREE /dev/VolGroup00/docker-pool

You can check out more docker diskspace tips here

Thanks

查看更多
姐就是有狂的资本
4楼-- · 2019-02-09 16:28

Docker stores all layers/images in its file formate (i.e. aufs) in default /var/lib/docker directory.

If you are getting disk space warning because of docker then there must of lot of docker images and you need to clean up it.

If you have option to add disk space then can you create separate partition with bigger size and mount your /var/lib/docker over there which will help you to get rid of filling root partition.

some extra information can be found here on managing disk space for docker . http://www.scmtechblog.net/2016/06/clean-up-docker-images-from-local-to.html

查看更多
登录 后发表回答