Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildah 1.39.0: When using BUILDAH_ISOLATION=chroot, symlinks are not followed correctly (?) #6001

Open
mh21 opened this issue Feb 24, 2025 · 1 comment
Assignees
Labels
jira Issues which will be sync'd to a card at https://issues.redhat.com/projects/RUN

Comments

@mh21
Copy link

mh21 commented Feb 24, 2025

When using buildah on FC42/Rawhide, /etc/os-release seems to come from the host fs, not the container building environment.

Reproducer:

$ podman run  --rm  -it --pull=newer --privileged quay.io/fedora/fedora:42 sh -c "dnf install buildah -y; printf 'FROM quay.io/fedora/fedora:40\nRUN cat /etc/os-release\nRUN cat /usr/lib/os-release' > Dockerfile; buildah build .; BUILDAH_ISOLATION=chroot buildah build ."|grep PLATFORM_ID
PLATFORM_ID="platform:f40"
PLATFORM_ID="platform:f40"
PLATFORM_ID="platform:f42"
PLATFORM_ID="platform:f40"
$ podman run  --rm  -it --pull=newer --privileged quay.io/fedora/fedora:41 sh -c "dnf install buildah -y; printf 'FROM quay.io/fedora/fedora:40\nRUN cat /etc/os-release\nRUN cat /usr/lib/os-release' > Dockerfile; buildah build .; BUILDAH_ISOLATION=chroot buildah build ."|grep PLATFORM_ID
PLATFORM_ID="platform:f40"
PLATFORM_ID="platform:f40"
PLATFORM_ID="platform:f40"
PLATFORM_ID="platform:f40"

This runs a FC container via podman, installs buildah, and than outputs the contents of /etc/os-release and /usr/lib/os-release and greps for the version number, once without BUILDAH_ISOLATION and once with BUILDAH_ISOLATION=chroot.

On FC <= 41, this outputs PLATFORM_ID="platform:f40" four times. On FC >= 42, this outputs the PLATFORM_ID from the host fs once (for BUILDAH_ISOLATION=chroot and /etc/os-release).

Expected behavior: /etc/os-release comes from the container building environment.

Buildah version: buildah x86_64 2:1.39.0-1.fc42 fedora

@mh21 mh21 changed the title buildah 1.38.1: When using BUILDAH_ISOLATION=chroot, symlinks are not followed correctly (?) buildah 1.39.0: When using BUILDAH_ISOLATION=chroot, symlinks are not followed correctly (?) Feb 24, 2025
@mh21
Copy link
Author

mh21 commented Feb 24, 2025

This seems to work correctly on a FC42 container with buildah 1.38.1:

$ podman run  --rm  -it --pull=newer --privileged quay.io/fedora/fedora:42 sh -c "dnf install https://kojipkgs.fedoraproject.org//packages/buildah/1.38.1/1.fc42/x86_64/buildah-1.38.1-1.fc42.x86_64.rpm -y; printf 'FROM quay.io/fedora/fedora:40\nRUN cat /etc/os-release\nRUN cat /usr/lib/os-release' > Dockerfile; buildah build .; BUILDAH_ISOLATION=chroot buildah build ."|grep PLATFORM_ID
PLATFORM_ID="platform:f40"
PLATFORM_ID="platform:f40"
PLATFORM_ID="platform:f40"
PLATFORM_ID="platform:f40"

@nalind nalind self-assigned this Feb 24, 2025
@nalind nalind added the jira Issues which will be sync'd to a card at https://issues.redhat.com/projects/RUN label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira Issues which will be sync'd to a card at https://issues.redhat.com/projects/RUN
Projects
None yet
Development

No branches or pull requests

2 participants