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