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

Command create-stack fails: building at STEP "RUN mkdir -p /etc/buildpacks": while running runtime: exit status 127 #345

Open
cmoulliard opened this issue Aug 30, 2024 · 4 comments

Comments

@cmoulliard
Copy link

cmoulliard commented Aug 30, 2024

Issue

The following command:

jam create-stack --config stack.toml --build-output build --run-output build

fails when it is executed on a Linux VM where the user is not root
and reports the following error

building at STEP "RUN mkdir -p /etc/buildpacks": while running runtime: exit status 127

Steps to Reproduce

  1. Install a centos or RHEL9 vm
  2. Install podman and start it
systemctl --user start podman.socket
ls $XDG_RUNTIME_DIR/podman/podman.sock
  1. Git clone : https://github.com/paketo-community/ubi-base-stack
  2. Install jam: v2.7.3
  3. cd ubi-base-stack/stack
  4. export the DOCKER_HOST export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock
  5. Run jam create-stack --config stack.toml --build-output build --run-output build

Versions

  • jam: v2.7.3
  • podman: 4.9.4-rhel
@BarDweller
Copy link

Unable to recreate...

+ cat /etc/fedora-release
Fedora release 39 (Thirty Nine)
+ podman --version
podman version 4.9.5
+ export DOCKER_HOST=unix:///run/user/1000/podman/podman.sock
+ DOCKER_HOST=unix:///run/user/1000/podman/podman.sock
+ systemctl --user start podman.socket
+ systemctl --user status podman.socket
● podman.socket - Podman API Socket
     Loaded: loaded (/usr/lib/systemd/user/podman.socket; enabled; preset: disabled)
     Active: active (listening) since Wed 2024-09-04 09:32:13 EDT; 2h 23min ago
   Triggers: ● podman.service
       Docs: man:podman-system-service(1)
     Listen: /run/user/1000/podman/podman.sock (Stream)
     CGroup: /user.slice/user-1000.slice/[email protected]/app.slice/podman.socket

Sep 04 09:32:13 PODMANVM systemd[1033131]: Listening on podman.socket - Podman API Socket.
+ ./jam-linux-amd64 version
jam 2.9.0
+ git clone https://github.com/paketo-community/ubi-base-stack
Cloning into 'ubi-base-stack'...
remote: Enumerating objects: 758, done.
remote: Counting objects: 100% (480/480), done.
remote: Compressing objects: 100% (230/230), done.
remote: Total 758 (delta 324), reused 333 (delta 237), pack-reused 278 (from 1)
Receiving objects: 100% (758/758), 505.21 KiB | 4.11 MiB/s, done.
Resolving deltas: 100% (406/406), done.
+ cd ubi-base-stack
+ cp images.json stack
+ cd stack
+ ../../jam-linux-amd64 create-stack --config stack.toml --build-output build --run-output run
Building io.buildpacks.stacks.ubi8
  Building on linux/amd64
    Building base images
      Build complete for base images
    build: Decorating base image
      Adding CNB_* environment variables
      Adding io.buildpacks.stack.* labels
      Creating cnb user
    run: Decorating base image
      Adding io.buildpacks.stack.* labels
      Creating cnb user
      Updating /etc/os-release
    build: Updating image
    run: Updating image

  Exporting build image to build
  Exporting run image to run

@cmoulliard
Copy link
Author

I did a new test on a RHEL9 VM using jam 2.9.0 and the error is still there. I think that permissions are different between fedora39 and RHEL ?

jam create-stack "--config ./stack/stack.toml --build-output ./stack/build/build.oci --run-output ./stack/build/run.oci"
Building io.buildpacks.stacks.ubi8
  Building on linux/amd64
    Building base images
Error: build failed:

building at STEP "RUN mkdir -p /etc/buildpacks": while running runtime: exit status 127

@cmoulliard
Copy link
Author

FYI: We got also the same error if we build the dockerfile using podman directly

[cloud-user@rhel-9 stack]$ podman build -f build.Dockerfile .
STEP 1/5: FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
STEP 2/5: USER root
--> 929b0659d190
STEP 3/5: RUN mkdir -p /etc/buildpacks
/bin/sh: error while loading shared libraries: libtinfo.so.6: cannot change memory protections
Error: building at STEP "RUN mkdir -p /etc/buildpacks": while running runtime: exit status 127

@BarDweller

@cmoulliard
Copy link
Author

The workaround as documented here: containers/podman#3234 is to do:

sudo setenforce 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants