# Podman fails on build with any RUN command in Containerfile on fresh Rocky Install

**URL:** <https://forums.rockylinux.org/t/podman-fails-on-build-with-any-run-command-in-containerfile-on-fresh-rocky-install/17475>\
**Category:** Rocky Linux Help & Support\
**Created:** [February 8, 2025, 12:59am UTC](https://forums.rockylinux.org/t/podman-fails-on-build-with-any-run-command-in-containerfile-on-fresh-rocky-install/17475 "2025-02-08T00:59:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![UniqueUsername](https://avatars.discourse-cdn.com/v4/letter/u/43a26b/32.png) [@UniqueUsername](https://forums.rockylinux.org/u/UniqueUsername)\
**Post date:** [February 8, 2025, 12:59am UTC](https://forums.rockylinux.org/t/podman-fails-on-build-with-any-run-command-in-containerfile-on-fresh-rocky-install/17475/1 "2025-02-08T00:59:42Z")

</div>

Hi, I have a fresh install of Rocky 9.5.

Also I have a container file that looks like this:

```auto
FROM rockylinux:9
COPY . .
RUN dnf -y update && dnf -y install git && dnf clean all
WORKDIR /buildbox
USER buildbox
ENTRYPOINT ["sleep", "infinity"]

```

I get this error on build command: `podman build -t buildbox1 .`:

```auto
STEP 3/7: RUN dnf -y update && dnf -y install git && dnf clean all
error running container: from /usr/bin/crun creating container for [/bin/sh -c dnf -y update && dnf -y install git && dnf clean all]: executable file `/bin/sh` not found in $PATH: No such file or directory
: exit status 1
ERRO[0000] did not get container create message from subprocess: EOF
Error: building at STEP "RUN dnf -y update && dnf -y install git && dnf clean all": while running runtime: exit status 1

```

This is not my experience on other vendors. I don’t know where to start, because I haven’t done anything on the system yet that would cause it. (It’s so new) so don’t know what to roll back.

Things I’ve done:

- I’ve turned of selinux.
- I’ve tried with Fedora `FROM quay.io/fedora/fedora:41/0` and Rocky images, get the same error.
- if I run `podman run hello` it works as expected. So doubly lost.
- I get this error anytime I do a`RUN` from any image. If I take out the `RUN` it builds and runs fine, I can exec to bash.
- `podman run --rm -it quay.io/fedora/fedora:41 ls -l /bin/sh` works

Any suggestions on how to resolve this? Thx

UPDATE:

- added another step to things I’ve done.
- It looks like the `COPY . .` is causing the problem, not sure how, and it seems weird. So probably not a Rocky Problem. Leave it up if anyone has any insight

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [February 8, 2025, 10:37am UTC](https://forums.rockylinux.org/t/podman-fails-on-build-with-any-run-command-in-containerfile-on-fresh-rocky-install/17475/2 "2025-02-08T10:37:38Z")

</div>

I believe the copy command should be more specific than what you have used. It may also not like the fact you are attempting to copy files where the Dockerfile is located. It would be better if you are wanting to copy multiple files, to use something like:

```auto
COPY nginx-conf/* /etc/nginx/conf.d/

```

as an example by storing the files to be copied in a sub-directory where your Dockerfile exists.

---

<div class="post-metadata">

**Author:** ![UniqueUsername](https://avatars.discourse-cdn.com/v4/letter/u/43a26b/32.png) [@UniqueUsername](https://forums.rockylinux.org/u/UniqueUsername)\
**Post date:** [February 9, 2025, 12:50am UTC](https://forums.rockylinux.org/t/podman-fails-on-build-with-any-run-command-in-containerfile-on-fresh-rocky-install/17475/3 "2025-02-09T00:50:56Z")

</div>

yes it was the circular ref of copying files on to itself which wasn’t obvious to me. The error message had me going down the wrong path. Thx

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [April 10, 2025, 12:51am UTC](https://forums.rockylinux.org/t/podman-fails-on-build-with-any-run-command-in-containerfile-on-fresh-rocky-install/17475/4 "2025-04-10T00:51:31Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
