Closed adelton closed 11 months ago
Thanks for the following the issue.
When I implemented the fix for /etc/resolv.conf
file, it didn't show any diff anymore. So, I thought it would be enough.
OS: AlmaLinux OS 9.3 Podman: 4.6.1-5.el9 from Appstream repository.
git clone https://github.com/AlmaLinux/docker-images --single-branch
cd docker-images
podman build -t diff-test -f dockerfiles/al8/Dockerfile.base .
podman run --name test-diff localhost/diff-test date
Fri Nov 24 16:50:35 UTC 2023
podman diff test-diff
Now, I can reproduce the issue if I use the docker.io/almalinux/8-base
image. I wonder what is the difference between the registry and local build one. :thinking:
I don't have a good insight into how things are built, as also mentioned in https://github.com/AlmaLinux/docker-images/issues/97#issuecomment-1741755310 where I saw the /etc/resolv.conf
in an image I built locally.
I just built it with docker as the pipeline does, can confirm that podman build
creates the /etc/hostname
but docker build
doesn't.
Ah, so the problem is that during docker build
, something is mounted there, so the touch
or COPY --from=stage2
or something similar does not affect the resulting layer?
I wonder how Fedora / RHEL UBI images do that ...
The touch
method on #102 solved the half of the issue, what is left to add it for the /etc/hostname
too, just tested with docker build
and it works.
Ah, that is good news.
Is anything else good with images? I'd like to hear your valuable feedback before proceed to build and publish with the proposed fix.
This should be the last thing I'm aware of WRT the images content.
See the /etc/hostname
inside the diff.
https://github.com/docker-library/official-images/pull/15765#issuecomment-1826177022
Description of problem
This is a continuation of https://github.com/AlmaLinux/docker-images/issues/97, now for
/etc/hostname
.Due to bug https://bugzilla.redhat.com/show_bug.cgi?id=1941142 which is present in all recent podman version as well, running
podman diff
on an AlmaLinux-based container reportsC /etc
even if nothing in the container changed. It's due to the fact that the container images do not contain/etc/hostname
.Steps to reproduce
Actual results
Expected results
Nothing output by that
podman diff
command.Additional information
I believe that this is caused by
/etc/hostname
missing on the image, similar to/etc/resolv.conf
which got added in https://github.com/AlmaLinux/docker-images/pull/102.