containers / skopeo

Work with remote images registries - retrieving information, images, signing content
Apache License 2.0
7.99k stars 764 forks source link

Skopeo copy - Error during unshare(...) Operation not permitted #2377

Closed Raboo closed 1 week ago

Raboo commented 1 month ago

Hi I'm running skopeo copy in a github actions runner that is using runs-on: ubuntu-24.04.

My copy command is producing an error.

skopeo copy containers-storage:ghcr.io/raboo/redir:build-amd64 oci-archive:/tmp/amd64-oci.tar
Error during unshare(...): Operation not permitted

Trying to copy a image that is built using buildah. This unshare error doesn't tell much. Is there a problem when reading from containers-storage or when making a new OCI tarball or when writing it to /tmp? How do I fix this?

Thanks

mtrmac commented 1 month ago

Thanks for reaching out.

That’s happening when switching to a user namespace in order to access the containers-storage location. If Buildah is running in the same environment, I‘d expect the environment to be allowing the operation.

The error is reported from a direct system call, so there probably isn’t much more specific information than the EPERM reported.

Raboo commented 1 month ago

Should be same namespace. This is pretty much what I'm doing in github actions.

    - name: Build Image
      id: build-image
      uses: redhat-actions/buildah-build@v2
      with:
        image: redir
        tags: ${{ steps.meta.outputs.tags }}
        labels: ${{ steps.meta.outputs.labels }}
        oci: true
        containerfiles: |
          ./Containerfile
        platforms: ${{ matrix.platform }}

    - run: skopeo copy containers-storage:ghcr.io/${{ env.OWNER_LC }}/redir:build-${{ env.PODMAN_ARCH }} oci-archive:/tmp/${{ env.PODMAN_ARCH }}-oci.tar
github-actions[bot] commented 2 weeks ago

A friendly reminder that this issue had no activity for 30 days.

Raboo commented 1 week ago

I created an issue for the github runner, https://github.com/actions/runner-images/issues/10443. Since it works in ubuntu-22.04 runner, but not in 24.04, so it should be an runner issue and not skopeo.