buildah: buildah bud 'RUN' incorrectly executing entrypoint
Description
When an entry point is configured in a Dockerfile executed by buildah bud, the RUN commands in the Dockerfile triggers execution of the configured ENTRYPOINT value.
Credit to @adelton for initial report and reproducer.
Steps to reproduce the issue:
buildah budthe following Docker file
FROM centos:7
RUN uuidgen > /build-id-pre-entrypoint
ENTRYPOINT [ "/non/existent/entrypoint" ]
RUN uuidgen > /build-id-post-entrypoint
Result:
STEP 1: FROM centos:7
STEP 2: RUN uuidgen > /build-id-pre-entrypoint
STEP 3: ENTRYPOINT [ "/non/existent/entrypoint" ]
STEP 4: RUN uuidgen > /build-id-post-entrypoint
container_linux.go:348: starting container process caused "exec: \"/non/existent/entrypoint\": stat /non/existent/entrypoint: no such file or directory"
error building at step {Env:[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin] Command:run Args:[uuidgen > /build-id-post-entrypoint] Flags:[] Attrs:map[] Message:RUN uuidgen > /build-id-post-entrypoint Original:RUN uuidgen > /build-id-post-entrypoint}: exit status 1
Describe the results you received:
Second RUN command in Dockerfile executes using ENTRYPOINT configured in previous step
RUN command in Dockerfile should not execute using ENTRYPOINT when built with buildah bud.
Describe the results you expected:
Successful RUN execution without use of configured ENTRYPOINT to match Docker behaviour.
Output of rpm -q buildah or apt list buildah:
buildah-0.16-201804191042.gite008b73.el7.x86_64
Output of buildah version:
Version: 0.16
Go Version: go1.8.3
Image Spec: 1.0.0
Runtime Spec: 1.0.0
Git Commit: e008b73
Built: Thu Apr 19 21:58:48 2018
OS/Arch: linux/amd64
Output of cat /etc/*release:
CentOS Linux release 7.4.1708 (Core)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 23 (7 by maintainers)
@kbaegis, I setup a test for
ENVconfigured in both the same Dockerfile and an image sourced usingFROMand in both cases ENV behaved correctly, and the behaviour inbuildah budmatched that ofdocker build.If you can provide a specific reproducer I can take a closer look. I am going to add this
ENVscenario to thebudCI tests.-edit-
Added #688 to test the ENV scenarios.