AlmaLinux / docker-images

Home for AlmaLinux Docker image RootFS files and production version of sources
MIT License
100 stars 27 forks source link

`podman diff` reports `C /etc` #97

Closed adelton closed 12 months ago

adelton commented 1 year ago

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 reports C /etc even if nothing in the container changed. It's due to the fact that the container images do not contain /etc/resolv.conf.

Steps to reproduce:

Actual results:

C /etc

Expected results:

Nothing output by that podman diff command.

Additional information:

I believe that this is caused by

$ podman run --dns=none --rm docker.io/almalinux/8-base cat /etc/resolv.conf
cat: /etc/resolv.conf: No such file or directory

Even if this is a podman problem and not AlmaLinux problem, please consider adding a workaround by having a placeholder file in the container because it makes it hard to debug software based on AlmaLinux and hides runtime changes that it might be doing in /etc.

For example, Fedora has

$ podman run --dns=none --rm registry.fedoraproject.org/fedora cat /etc/resolv.conf
# resolv placeholder
adelton commented 1 year ago

I would provide a patch but the repository documentation is not very clear how the images found on Docker Hub are built.

When I do

$ podman build -t localhost/almalinux-8 -f dockerfiles/al8/Dockerfile.base .
[...]
[3/3] STEP 4/4: CMD ["/bin/bash"]
--> Using cache 39f91e97c12188f45f38c9de440e356a7a3852faf8bdd39bb2e39e01ea527689
[3/3] COMMIT localhost/almalinux-8
--> 39f91e97c121
Successfully tagged localhost/almalinux-8:latest
Successfully tagged localhost/almalinux/8-base:latest
39f91e97c12188f45f38c9de440e356a7a3852faf8bdd39bb2e39e01ea527689
$ podman run --dns=none --rm localhost/almalinux-8:latest ls -la /etc/resolv.conf
-rwx------. 1 root root 0 Sep 30 11:40 /etc/resolv.conf

the /etc/resolv.conf is clearly in the image.

adelton commented 1 year ago

The /etc/hostname also needs to get added.

LKHN commented 11 months ago

See /etc/resolv.conf in the diff: https://github.com/docker-library/official-images/pull/15760#issuecomment-1823180278