redhat-actions / buildah-build

GitHub Action to use 'buildah' to build a container image.
https://github.com/marketplace/actions/buildah-build
MIT License
136 stars 35 forks source link

[BUG] `entrypoint` configured as `]` when building from scratch with `ENTRYPOINT`-less base image #141

Closed dannywebster closed 1 month ago

dannywebster commented 1 month ago

Version

redhat-actions/push-to-registry@v2

Describe the bug

When building without a Containerfile, and using UBI8 (ubi8/ubi-minimal:8.10 or any other for that matter) - and not specifying entrypoint, buildah config ends up writing this:

/usr/bin/buildah config --entrypoint ] working-container

.. and the resulting image's manifest:

  "Entrypoint": [
         "/bin/sh",
         "-c",
         "]"
   ],

This bracket is being returned from this line.

Note, that the UBI image in question has no ENTRYPOINT, but does have a CMD as per its Dockerfile. I saw in an older buildah issue, that in the presence of an ENTRYPOINT, CMD should be ignored, but this doesn't seem to be the case, as when I do specify an entrypoint to the action, we end up with both:

 "Cmd": [
                "/bin/bash"
            ],
            "Entrypoint": [
                "bash"
            ],

I've tried this with/without OCI - no difference.

Steps to reproduce, workflow links, screenshots

This is all with buildah version 1.33.7 (image-spec 1.1.0-rc.5, runtime-spec 1.1.0)

The step and its enumerated inputs:

- name: Build Image via Buildah
      uses: redhat-actions/buildah-build@v2
      with:
        oci: true
        base-image: registry.access.redhat.com/ubi8/ubi-minimal:8.10
        image: localhost/foo
        tags: 0.1
        content: somedir

Cheers!

dannywebster commented 1 month ago

closing as dupe of https://github.com/redhat-actions/buildah-build/issues/136