English 中文(简体)
我如何能够确定 Docker没有留下任何空间在装置错误上?
原标题:How can I fix No space left on device error in Docker?
  • 时间:2016-12-19 17:01:34
  •  标签:
  • docker

I m 运行一个宏观分析仪(没有虚拟箱/多克机械)。

I have a huge image with a lot of infrastructure in it (Postgres, etc.). I have run cleanup scripts to get rid of a lot of cruft--unused images and so forth.

当我掌握我的形象时,我会遇到这样的错误:

could not create directory "/var/lib/postgresql/data/pg_xlog": No space left on device

我的东道主Mac /var坐在60%的可用空间上,而且一般来说,我的磁盘可以自由储存。

难道这是我需要放弃的吗?

《<条码>第4条 inside:

none on / type aufs (rw,relatime,si=5b19fc7476f7db86,dio,dirperm1)
/dev/vda1 on /data type ext4 (rw,relatime,data=ordered)
/dev/vda1 on /etc/resolv.conf type ext4 (rw,relatime,data=ordered)
/dev/vda1 on /etc/hostname type ext4 (rw,relatime,data=ordered)
/dev/vda1 on /etc/hosts type ext4 (rw,relatime,data=ordered)
/dev/vda1 on /var/lib/postgresql/data type ext4 (rw,relatime,data=ordered)

这里的<代码>df:

[11:14]  
Filesystem     1K-blocks    Used Available Use% Mounted on
none           202054928 4333016 187269304   3% /
tmpfs            1022788       0   1022788   0% /dev
tmpfs            1022788       0   1022788   0% /sys/fs/cgroup
/dev/vda1      202054928 4333016 187269304   3% /data
shm                65536       4     65532   1% /dev/shm
tmpfs             204560     284    204276   1% /run/docker.sock
问题回答

我与另一个问题一样,从docker system prunevol-umes上解决这一问题。

"Volumes are not pruned by default, and you must specify the --volumes flag for docker system prune to prune volumes."

See: https://docs.docker.com/config/pruning/#prune-everything

我最近用一个cker器安装在灯塔上,使用<代码>devicemapper存储动力(fault)。 我确实需要变换,以解决这个问题。

Docker images are made of read-only layers of filesystem snapshots, each layer created by a command in your Dockerfile, which are built on top of a common base storage snapshot. The base snapshot is shared by all your images and has a file system with a default size of 10GB. When you run your image you get a new writable layer on top of all the layers in the image, so you can add new files in your running container but it s still eventually based on the same base snapshot with the 10GB filesystem. This is at least true for devicemapper, not sure about other drivers. Here is the relevant documentation from docker.

为了将这一缺省价值改变到别处,你可以设定一个 da子参数,例如docker daemon --storage-opt dm.basesize=100G。 由于你可能不敢手工操作 da魔,因此,在某些档案中,视你如何操作cker子 da魔,需要ed弄cker子的 options子。 在“条码”下的偏好中,你可以把 da子参数作为耳光。 Daemon->Advanced 。 也许需要增加这样的内容:

{
    "storage-opts": ["dm.basesize=100G"]
}

(but like I said, I had this problem on linux, so didn t try the above).

Anyway in order for this to take effect, you ll need to remove all your existing images (so that they re re-created on top of the new base snapshot with the new size). See storage driver options.

如果你想用<条码> do照图像prune-a做任何改动。

这个问题也发生在我身上。

对我来说,固定点是增加多克桌面(Mac)的虚拟游击尺寸。

Virtual Disk Limit setting





相关问题
Unable to connect to docker container inside windows server

As title. I am developing a system with many docker images with ASP.Net MVC core projects. I am publishing these docker images into a docker engine installed on Windows Server OS, and I found that I ...

Only can see postgreSQL as an admin

After installed Wsl and Docker, can t access PSQL and other things. I was studying Docker, and installed the latest version. So far so good, I received an error about the WSL version, saw some ...

make docker-compose block until healthy without `depends_on`

I am working with a team that uses docker-compose to start a set of helper services, but does not use docker when the code is being developed. Here, docker-compose is just a convenient way to run the ...

change grafana port using docker host network

I am trying to spin up a grafana container in docker, however my setup in docker does not allow ipv4 forwarding and thus I cannot use the default bridge network in docker. All I can use is the host ...

Pip instalation for Python 3.11 in docker

I have Dockerfile to build image for Django project that uses Python 3.11 and runs in poetry environment (see content below). Problem is when I try to donwload get-pip.py file and run it using Python, ...

在 Dockerfile 中运行 composer install

我正在尝试将我的Laravel应用程序进行Docker化。 该应用程序已经构建并在Git中,但我将vendor文件夹添加到了.gitignore中。 我添加了一个Dockerfile,看起来像这样: FROM php:7.1-fpm-alpine RUN apk update ...

热门标签