You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A image is built by container committed, when we remove the image, the snapshots for the image still exist.
Ⅱ. Describe what happened
As said above.
Ⅲ. Describe what you expected to happen
If a image is removed, the snapshots for the image should be cleaned. (Except the image is parent of committed containers).
Ⅳ. How to reproduce it (as minimally and precisely as possible)
Create a container by a image, like registry.hub.docker.com/library/busybox:1.28.
[root@xxxx /home/allen]
#pouch ps -a
Name ID Status Created Image Runtime
test f63087 Exited (0) 1 minute 1 minute ago registry.hub.docker.com/library/busybox:1.28 runc
[root@xxxx /home/allen]
#ls /home/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/
1 2
We can see snapshots 1 and 2.
Commit the container to a new image ( committed_image:test ). We can know a snapshot (such as 4) is for the new image. We could get it from containerd snapshot dir( such as /home/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/ ).
Remove the new image committed_image:test. And the snapshot (a dir as /home/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/4) still exists.
Even though I remove all containers and images, the snapshot 4 is still existed.
[root@xxxx /home/allen]
#pouch ps -a
Name ID Status Created Image Runtime
[root@xxxx /home/allen]
#pouch images
IMAGE ID IMAGE NAME SIZE
[root@xxxx /home/allen]
#ls /home/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/
1 4
Ⅴ. Anything else we need to know?
when a container is committed to a image, Pouch will new a snapshot for the diff content in container. When a snapshot is created, it sets a label "containerd.io/gc.root". A snapshot with the label will not be removed, Even though the snapshot is not referred. ( Related to https://github.com/alibaba/pouch/blob/master/ctrd/image_commit.go#L266)
Ⅵ. Environment:
#pouch version
GitCommit: 7acb407
GoVersion: go1.9.1
KernelVersion: 4.9.93-010.ali3000.alios7.x86_64
Os: linux
Version: 1.0.0
APIVersion: 1.24
Arch: amd64
BuildTime: 2018-11-19T07:08:36+00:00
pouch version (use pouch version):
OS (e.g. from /etc/os-release):
Kernel (e.g. uname -a):
Install tools:
Others:
The text was updated successfully, but these errors were encountered:
wangforthinker
changed the title
[bug] If container is committed to a image, after the image is cleaned, the snapshots for the image still exist.
[bug] If container is committed to a image, after the image is removed, the snapshots for the image still exist.
Dec 13, 2018
fuweid
changed the title
[bug] If container is committed to a image, after the image is removed, the snapshots for the image still exist.
[bug report] If container is committed to a image, after the image is removed, the snapshots for the image still exist.
Dec 27, 2018
For `containerd.io/gc.root` label means the content/snapshot cannot be
removed during gc. If we use it for snapshot, the snapshot cannot be
removed during removing image.
By default, we should add
`containerd.io/gc.ref.snapshot.{snapshot-name}` gc label to the image
config so that gc can remove the snapshot if user tries to remove the
image.
close#2556
Signed-off-by: Wei Fu <fuweid89@gmail.com>
For `containerd.io/gc.root` label means the content/snapshot cannot be
removed during gc. If we use it for snapshot, the snapshot cannot be
removed during removing image.
By default, we should add
`containerd.io/gc.ref.snapshot.{snapshot-name}` gc label to the image
config so that gc can remove the snapshot if user tries to remove the
image.
close#2556
Signed-off-by: Wei Fu <fuweid89@gmail.com>
Ⅰ. Issue Description
A image is built by container committed, when we remove the image, the snapshots for the image still exist.
Ⅱ. Describe what happened
As said above.
Ⅲ. Describe what you expected to happen
If a image is removed, the snapshots for the image should be cleaned. (Except the image is parent of committed containers).
Ⅳ. How to reproduce it (as minimally and precisely as possible)
We can see snapshots 1 and 2.
Even though I remove all containers and images, the snapshot 4 is still existed.
Ⅴ. Anything else we need to know?
when a container is committed to a image, Pouch will new a snapshot for the diff content in container. When a snapshot is created, it sets a label "containerd.io/gc.root". A snapshot with the label will not be removed, Even though the snapshot is not referred. ( Related to https://github.com/alibaba/pouch/blob/master/ctrd/image_commit.go#L266)
Ⅵ. Environment:
pouch version
):uname -a
):The text was updated successfully, but these errors were encountered: