Podman build and commit does not seem to use overlayfs
Hi, I run podman as root, but it seems that the build and commit commands always create images that double the size on every change. I run podman on ArchLinux with F2FS disk. Is F2FS not supported? I could not find anything on the web that mentions this. # podman info host: arch: amd64 buildahVersion: 1.14.8 cgroupVersion: v1 conmon: package: Unknown path: /usr/bin/conmon version: 'conmon version 2.0.15, commit: 1bddbf7051a973f4a4fecf06faa0c48e82f1e9e1' cpus: 8 distribution: distribution: arch version: unknown eventLogger: file hostname: archasw idMappings: gidmap: null uidmap: null kernel: 5.6.10-arch1-1 memFree: 8687009792 memTotal: 16554958848 ociRuntime: name: runc package: Unknown path: /usr/bin/runc version: |- runc version 1.0.0-rc10 commit: dc9208a3303feef5b3839f4323d9beb36df0a9dd spec: 1.0.1-dev os: linux rootless: false slirp4netns: executable: "" package: "" version: "" swapFree: 0 swapTotal: 0 uptime: 20h 4m 31.66s (Approximately 0.83 days) registries: search: - docker.io - registry.fedoraproject.org - quay.io - registry.access.redhat.com - registry.centos.org store: configFile: /etc/containers/storage.conf containerStore: number: 3 paused: 0 running: 0 stopped: 3 graphDriverName: overlay graphOptions: overlay.mountopt: nodev graphRoot: /var/lib/containers/storage graphStatus: Backing Filesystem: f2fs Native Overlay Diff: "false" Supports d_type: "true" Using metacopy: "true" imageStore: number: 5 runRoot: /var/run/containers/storage volumePath: /var/lib/containers/storage/volumes Example with commit: # podman image tree centos7-systemd Image ID: 0cd1f34a88bc Tags: [localhost/centos7-systemd:latest] Size: 227.7MB Image Layers └── ID: 913cda0bf08e Size: 227.7MB Top Layer of: [localhost/centos7-systemd:latest] # podman run -it centos7-systemd /bin/bash # yum update # exit # podman commit inspiring_ganguly inspiring_ganguly # podman image tree inspiring_ganguly Image ID: feb029dfb122 Tags: [localhost/inspiring_ganguly:latest] Size: 436.4MB Image Layers ├── ID: 913cda0bf08e Size: 227.7MB Top Layer of: [localhost/centos7-systemd:latest] └── ID: 3ff0a6be06fa Size: 208.7MB Top Layer of: [localhost/inspiring_ganguly:latest] Regards, Alvin
Regrettably, I'd never even heard of F2FS. I'm 99% sure that's not a file system we are testing. Just to be transparent, we only support XFS on RHEL, so that's probably the best tested solution. I have also used it on EXT4 without a problem. Mileage may vary when you get outside XFS and EXT4. Others might have a better understanding of F2FS and why it might cause this doubling problem. On Wed, May 6, 2020 at 2:26 AM Alvin Sebastian <a.sebastian@uq.edu.au> wrote:
Hi,
I run podman as root, but it seems that the build and commit commands always create images that double the size on every change. I run podman on ArchLinux with F2FS disk. Is F2FS not supported? I could not find anything on the web that mentions this.
# podman info host: arch: amd64 buildahVersion: 1.14.8 cgroupVersion: v1 conmon: package: Unknown path: /usr/bin/conmon version: 'conmon version 2.0.15, commit: 1bddbf7051a973f4a4fecf06faa0c48e82f1e9e1' cpus: 8 distribution: distribution: arch version: unknown eventLogger: file hostname: archasw idMappings: gidmap: null uidmap: null kernel: 5.6.10-arch1-1 memFree: 8687009792 memTotal: 16554958848 ociRuntime: name: runc package: Unknown path: /usr/bin/runc version: |- runc version 1.0.0-rc10 commit: dc9208a3303feef5b3839f4323d9beb36df0a9dd spec: 1.0.1-dev os: linux rootless: false slirp4netns: executable: "" package: "" version: "" swapFree: 0 swapTotal: 0 uptime: 20h 4m 31.66s (Approximately 0.83 days) registries: search: - docker.io - registry.fedoraproject.org - quay.io - registry.access.redhat.com - registry.centos.org store: configFile: /etc/containers/storage.conf containerStore: number: 3 paused: 0 running: 0 stopped: 3 graphDriverName: overlay graphOptions: overlay.mountopt: nodev graphRoot: /var/lib/containers/storage graphStatus: Backing Filesystem: f2fs Native Overlay Diff: "false" Supports d_type: "true" Using metacopy: "true" imageStore: number: 5 runRoot: /var/run/containers/storage volumePath: /var/lib/containers/storage/volumes
Example with commit:
# podman image tree centos7-systemd Image ID: 0cd1f34a88bc Tags: [localhost/centos7-systemd:latest] Size: 227.7MB Image Layers └── ID: 913cda0bf08e Size: 227.7MB Top Layer of: [localhost/centos7-systemd:latest]
# podman run -it centos7-systemd /bin/bash # yum update # exit # podman commit inspiring_ganguly inspiring_ganguly # podman image tree inspiring_ganguly Image ID: feb029dfb122 Tags: [localhost/inspiring_ganguly:latest] Size: 436.4MB Image Layers ├── ID: 913cda0bf08e Size: 227.7MB Top Layer of: [localhost/centos7-systemd:latest] └── ID: 3ff0a6be06fa Size: 208.7MB Top Layer of: [localhost/inspiring_ganguly:latest]
Regards, Alvin _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
-- -- Moving Wordpress, Mediawiki and Request Tracker into containers: http://crunchtools.com/a-hackers-guide-to-moving-linux-services-into-contain... -- Scott McCarty Product Management - Containers, Red Hat Enterprise Linux & OpenShift Email: smccarty@redhat.com Phone: 312-660-3535 Cell: 330-807-1043 Web: http://crunchtools.com Using Azure Pipelines with Red Hat Universal Base Image and Quay.io: https://red.ht/2TvYo3Y
On 2020-05-06 06:23, Alvin Sebastian wrote:
Hi,
I run podman as root, but it seems that the build and commit commands always create images that double the size on every change. I run podman on ArchLinux with F2FS disk. Is F2FS not supported? I could not find anything on the web that mentions this.
# podman info host: arch: amd64 buildahVersion: 1.14.8 cgroupVersion: v1 conmon: package: Unknown path: /usr/bin/conmon version: 'conmon version 2.0.15, commit: 1bddbf7051a973f4a4fecf06faa0c48e82f1e9e1' cpus: 8 distribution: distribution: arch version: unknown eventLogger: file hostname: archasw idMappings: gidmap: null uidmap: null kernel: 5.6.10-arch1-1 memFree: 8687009792 memTotal: 16554958848 ociRuntime: name: runc package: Unknown path: /usr/bin/runc version: |- runc version 1.0.0-rc10 commit: dc9208a3303feef5b3839f4323d9beb36df0a9dd spec: 1.0.1-dev os: linux rootless: false slirp4netns: executable: "" package: "" version: "" swapFree: 0 swapTotal: 0 uptime: 20h 4m 31.66s (Approximately 0.83 days) registries: search: - docker.io - registry.fedoraproject.org - quay.io - registry.access.redhat.com - registry.centos.org store: configFile: /etc/containers/storage.conf containerStore: number: 3 paused: 0 running: 0 stopped: 3 graphDriverName: overlay graphOptions: overlay.mountopt: nodev graphRoot: /var/lib/containers/storage graphStatus: Backing Filesystem: f2fs Native Overlay Diff: "false" Supports d_type: "true" Using metacopy: "true" imageStore: number: 5 runRoot: /var/run/containers/storage volumePath: /var/lib/containers/storage/volumes
Example with commit:
# podman image tree centos7-systemd Image ID: 0cd1f34a88bc Tags: [localhost/centos7-systemd:latest] Size: 227.7MB Image Layers └── ID: 913cda0bf08e Size: 227.7MB Top Layer of: [localhost/centos7-systemd:latest]
# podman run -it centos7-systemd /bin/bash # yum update # exit # podman commit inspiring_ganguly inspiring_ganguly # podman image tree inspiring_ganguly Image ID: feb029dfb122 Tags: [localhost/inspiring_ganguly:latest] Size: 436.4MB Image Layers ├── ID: 913cda0bf08e Size: 227.7MB Top Layer of: [localhost/centos7-systemd:latest] └── ID: 3ff0a6be06fa Size: 208.7MB Top Layer of: [localhost/inspiring_ganguly:latest]
Regards, Alvin
_______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
Is it just `podman build` (pulling with `podman pull` and running with `podman run` doesn't have the same issue)? Theoretically, everything should be using the same storage configuration, but `podman build` is actually Buildah code under the hood, so it does use substantially different code paths versus everything else. Thanks, Matt Heon
On 5/5/20 11:23 PM, Alvin Sebastian wrote:
I run podman as root, but it seems that the build and commit commands always create images that double the size on every change. ... # podman run -it centos7-systemd /bin/bash # yum update # exit # podman commit inspiring_ganguly inspiring_ganguly # podman image tree inspiring_ganguly Image ID: feb029dfb122 Tags: [localhost/inspiring_ganguly:latest] Size: 436.4MB Image Layers ├── ID: 913cda0bf08e Size: 227.7MB Top Layer of: [localhost/centos7-systemd:latest] └── ID: 3ff0a6be06fa Size: 208.7MB Top Layer of: [localhost/inspiring_ganguly:latest]
It's hard to say if what you're seeing is doubling the size on "every change", because "yum update" can easily create large layers. Both because it may apply updates, and because it will leave a fairly large cache in /var/cache/yum if you don't also "yum clean all" before you commit. Could you try a simpler change? I don't see the behavior you're seeing here. I'm not using F2FS, but I don't see a reason to think the FS is involved, yet. $ podman run -it centos:8 /bin/bash [root@d8a5cbded76a /]# touch test [root@d8a5cbded76a /]# exit $ podman commit objective_torvalds objective_torvalds $ podman image tree objective_torvalds Image ID: 5cf4ca3ac6fa Tags: [localhost/objective_torvalds:latest] Size: 227.6MB Image Layers ├── ID: aff9833d4641 Size: 227.6MB Top Layer of: [registry.centos.org/centos:8] └── ID: 1288ae30095b Size: 4.608kB Top Layer of: [localhost/objective_torvalds:latest]
Hi Gordon, You are spot on. The > 200MB size comes from yum. I remember that I also tested with just "touch test" back when I started using podman few months ago and each new layer has a size bigger than the previous one. I think it is somehow fixed now. Is there a way to optimise and merge all the layers in an image into one layer without having to use the build command and Dockerfile? ________________________________ From: Gordon Messmer <gordon.messmer@gmail.com> Sent: Thursday, 7 May 2020 1:35 PM To: podman@lists.podman.io <podman@lists.podman.io> Subject: [Podman] Re: Podman build and commit does not seem to use overlayfs On 5/5/20 11:23 PM, Alvin Sebastian wrote:
I run podman as root, but it seems that the build and commit commands always create images that double the size on every change. ... # podman run -it centos7-systemd /bin/bash # yum update # exit # podman commit inspiring_ganguly inspiring_ganguly # podman image tree inspiring_ganguly Image ID: feb029dfb122 Tags: [localhost/inspiring_ganguly:latest] Size: 436.4MB Image Layers ├── ID: 913cda0bf08e Size: 227.7MB Top Layer of: [localhost/centos7-systemd:latest] └── ID: 3ff0a6be06fa Size: 208.7MB Top Layer of: [localhost/inspiring_ganguly:latest]
It's hard to say if what you're seeing is doubling the size on "every change", because "yum update" can easily create large layers. Both because it may apply updates, and because it will leave a fairly large cache in /var/cache/yum if you don't also "yum clean all" before you commit. Could you try a simpler change? I don't see the behavior you're seeing here. I'm not using F2FS, but I don't see a reason to think the FS is involved, yet. $ podman run -it centos:8 /bin/bash [root@d8a5cbded76a /]# touch test [root@d8a5cbded76a /]# exit $ podman commit objective_torvalds objective_torvalds $ podman image tree objective_torvalds Image ID: 5cf4ca3ac6fa Tags: [localhost/objective_torvalds:latest] Size: 227.6MB Image Layers ├── ID: aff9833d4641 Size: 227.6MB Top Layer of: [registry.centos.org/centos:8] └── ID: 1288ae30095b Size: 4.608kB Top Layer of: [localhost/objective_torvalds:latest] _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
participants (4)
-
Alvin Sebastian -
Gordon Messmer -
Matt Heon -
Scott McCarty