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] Wrong entrypoint set when omitting the entrypoint parameter #136

Open picsel2 opened 2 months ago

picsel2 commented 2 months ago

Version

redhat-actions/push-to-registry@v2

Describe the bug

Building an image "from scratch" without providing an entrypoint parameter lets the action pass --entrypoint ] to buildah. This erroneously overrides the entrypoint given by a base image and breaks container execution.

Steps to reproduce, workflow links, screenshots

Example action

#[...]
    - name: Build container image
      uses: https://github.com/redhat-actions/buildah-build@v2
      with:
        base-image: docker.io/library/nginx:mainline-bookworm
        content: |
          public
          /usr/share/nginx/html          
        image: registry.grabel.de/grabel.de/site
        oci: true
#[...]

Action output

::group::/usr/bin/buildah version
[command]/usr/bin/buildah version
Version:         1.28.2
Go Version:      go1.19.8
Image Spec:      1.1.0-rc2
Runtime Spec:    1.0.2-dev
CNI Spec:        1.0.0
libcni Version:  
image Version:   5.23.1
Git Commit:      
Built:           Thu Jan  1 00:00:00 1970
OS/Arch:         linux/amd64
BuildPlatform:   linux/amd64
::endgroup::
Storage driver is not 'overlay', so not overriding storage configuration
Performing build from scratch
[command]/usr/bin/buildah from --tls-verify=true docker.io/library/nginx:mainline-bookworm
Trying to pull docker.io/library/nginx:mainline-bookworm...
Getting image source signatures
Copying blob sha256:93295add984dbd114a6f43401f08e6faf4510809e33e8f8a2e6485399fa0e03c
Copying blob sha256:8ddb1e6cdf341aca028fb6fc4cbd9c2ba9e9a1cae1b186a587f2dffe33c0d587
Copying blob sha256:988b92d96970464ab9435aa6af3077e283c1c8eacaee200f8c123315486066ec
Copying blob sha256:b0a0cf830b12453b7e15359a804215a7bcccd3788e2bcecff2a03af64bbd4df7
Copying blob sha256:5252b206aac298fb004dbe62210d127533f8aeb6a5eb0b8f79e28ddc01bd2419
Copying blob sha256:7102627a7a6e4da3b80e192b686d57139b8c6d4ff405918dd508e784a4abc639
Copying blob sha256:ebde0aa1d1aaad9d43da96b7f0e4a4ebccde16cc4d785944629f02406cd54b44
Copying config sha256:7383c266ef252ad70806f3072ee8e63d2a16d1e6bafa6146a2da867fc7c41759
Writing manifest to image destination
Storing signatures
nginx-working-container
[command]/usr/bin/buildah config --entrypoint ] nginx-working-container
time="2024-04-25T08:50:59Z" level=warning msg="cmd \"nginx -g daemon off;\" exists but will be ignored because of entrypoint settings"
[command]/usr/bin/buildah copy nginx-working-container public /usr/share/nginx/html
fc061c5e0221874626147f29d88b1fe3c1caad22eb586c226247d16b5e2e69f8
[command]/usr/bin/buildah commit --format oci --squash nginx-working-container registry.grabel.de/grabel.de/site:latest
Getting image source signatures
Copying blob sha256:1916481b1a7c62091627c97e8d167e3ba32b45952f12486dc600d4507eb2b0d5
Copying config sha256:d8891fe6be0533248f32f4671edc44bc18b4aa2629cf51b8303bb58c3a2ac8b5
Writing manifest to image destination
Storing signatures
d8891fe6be0533248f32f4671edc44bc18b4aa2629cf51b8303bb58c3a2ac8b5
✅ Successfully built image "registry.grabel.de/grabel.de/site:latest"