containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.83k stars 2.42k forks source link

mount `tmpfs` to `/dev`: Permission denied #16331

Closed dpkshetty closed 2 years ago

dpkshetty commented 2 years ago

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Steps to reproduce the issue:

  1. My gitlab-ci.yml (code snip which is failing...)

    
    - echo "Building container on ppc64le"
    - buildah --storage-driver=vfs build -t $APP .
    - echo "Build complete."
    
    - echo "Listing buildah images"
    - buildah --storage-driver=vfs images
    
    - echo "Push image to ${IMAGE_REGISTRY}:${TAG}"
    - buildah --storage-driver=vfs push --creds $quay_user:$quay_passwd $APP ${IMAGE_REGISTRY}:${TAG}-ppc64le

3. As you can see, I am using podman image to create a Dockerfile for my app. Link to Dockerfile
https://gitlab.com/dpkshetty/gitlab-s2i-pyflask-demo/-/blob/main/Dockerfile

4. podman build fails as below...

$ podman --storage-driver=vfs build -t $APP . time="2022-10-28T07:49:58Z" level=warning msg="\"/\" is not a shared mount, this could cause issues or missing mounts with rootless containers" STEP 1/7: FROM registry.access.redhat.com/ubi8/python-38 Trying to pull registry.access.redhat.com/ubi8/python-38:latest... Getting image source signatures Checking if image destination supports signatures Copying blob sha256:d0d2e9042a028b50d899ac4c9a760d0a2305d515d0ad127b377a8e437dde0623 Copying blob sha256:d172799e5c5b9a62cce0219edd286f524a25155a018d7eda982c0d0706ed9fa9 Copying blob sha256:32af3091e80b9aa028a918579576c3a34d03a59746461d16990a9077ddb8541b Copying blob sha256:9fb9feb1f76f717c6ae977c6d19b7aa7970602cbda1aea0072e9a669f0c94ad5 Copying config sha256:5e3e4648bb5c196e28e438f5ee535b7ffb36b0394dfab8ea1159d3ef5d32695a Writing manifest to image destination Storing signatures STEP 2/7: USER 0 --> 74803e52454 STEP 3/7: ADD app-src /tmp/src --> 353803cc6da STEP 4/7: RUN chown -R 1001:0 /tmp/src error running container: error from /usr/bin/crun creating container for [/bin/sh -c chown -R 1001:0 /tmp/src]: mount tmpfs to /dev: Permission denied : exit status 1 Error: error building at STEP "RUN chown -R 1001:0 /tmp/src": error while running runtime: exit status 1 Cleaning up project directory and file based variables 00:00 ERROR: Job failed: command terminated with exit code 1


**Describe the results you received:**

podman build fail

**Describe the results you expected:**

podman build should succeed

**Additional information you deem important (e.g. issue happens only occasionally):**

Please note that in the above gitlab-ci.yml, if I replace podman with buildah (image and CLI), it works!!

**Output of `podman version`:**

(paste your output here)


**Output of `podman info`:**

(paste your output here)


**Package info (e.g. output of `rpm -q podman` or `apt list podman` or `brew info podman`):**

(paste your output here)



**Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)**

Yes/No

**Additional environment details (AWS, VirtualBox, physical, etc.):**

podman container is running in openshift as part of gitlab CI pipeline
rhatdan commented 2 years ago

Have you read https://www.redhat.com/sysadmin/podman-inside-kubernetes?