img icon indicating copy to clipboard operation
img copied to clipboard

Docker image build simply skips the Entrypoint part

Open cmarasescu opened this issue 6 years ago • 6 comments

I have a Gitlab project that builds up a docker container with a python app. The build process was working just fine while using the dind runner:

Step 4/8 : COPY scripts/ /scripts ---> d0ba7c8bb765 Step 5/8 : COPY docker-entrypoint.sh / ---> ad41d0328446 Step 6/8 : RUN chmod +x /docker-entrypoint.sh ---> Running in 6011914a817f Removing intermediate container 6011914a817f ---> cac617a2148f Step 7/8 : ENTRYPOINT ["/usr/local/bin/dumb-init", "/docker-entrypoint.sh"] ---> Running in 395d0fb0c2ac Removing intermediate container 395d0fb0c2ac ---> 6b72a609bde0 Step 8/8 : CMD ["/usr/sbin/crond","-c","/etc/crontabs","-f"] ---> Running in 3f711d991f35 Removing intermediate container 3f711d991f35 ---> 84dffcdc9c8a Successfully built 84dffcdc9c8a

After changing the Gitlab runner to genuinetools img, the docker build process seems to work fine (no errors returned), but it simply skips the entrypoint and cmd parts in my Dockerfile:

#6 [4/5] COPY docker-entrypoint.sh / #6 digest: sha256:238319d7729f904101fc37624d765fb9c7dcab866be1d119bfe574a2adf88a31 #6 name: "[4/5] COPY docker-entrypoint.sh /" #6 started: 2018-10-30 10:44:54.665143453 +0000 UTC m=+76.982371679 #6 completed: 2018-10-30 10:44:55.710745591 +0000 UTC m=+78.027973619 #6 duration: 1.04560194s ​ ​ #7 [5/5] RUN chmod +x /docker-entrypoint.sh #7 digest: sha256:6b6215d2339dd59c400d248f547937d7ad5d5350072931b122089847157745b6 #7 name: "[5/5] RUN chmod +x /docker-entrypoint.sh" #7 started: 2018-10-30 10:44:55.712307399 +0000 UTC m=+78.029535607 #7 completed: 2018-10-30 10:44:56.69899719 +0000 UTC m=+79.016225205 #7 duration: 986.689598ms ​ ​ #11 exporting to image #11 digest: sha256:af2f855fd5e73c5545b0b65e7e4e2da3a2eef7fd9bdd68d39aafd6317a726514 #11 name: "exporting to image" #11 started: 2018-10-30 10:44:56.700167815 +0000 UTC m=+79.017396034 #11 exporting layers #11 completed: 2018-10-30 10:45:00.743425576 +0000 UTC m=+83.060653595 #11 duration: 4.043257561s #11 exporting layers 4.0s done #11 exporting manifest sha256:8e3dbcbc5a0bfdd3231e343c46dd0b48066f3a1375e8628bb5fe0589bec6383c done #11 exporting config sha256:fa26217db1b7dbe46f6eb74e3ea2fa93f9795a2217cb2b28dff77de5baebd49c done #11 naming to dockerhub.local:443/python_reports:unstable done ​ Successfully built dockerhub.local:443/python_reports:unstable

As the entrypoint and CMD parts are not processed, I cannot run my image - it fails with message "No command specified".

Can you please advise? Is this a bug? Has anyone else seen this behaviour?

cmarasescu avatar Nov 03 '18 06:11 cmarasescu

I have seen the same thing happening. Especially when pushing changes over a tag that was previously built / pushed with docker

msvechla avatar Nov 07 '18 11:11 msvechla

@jessfraz did you have some time to look into this? We are using img in production and for some reason this keeps happening.

ENTRYPOINT or CMD missing when then image is built with img, compared to docker. Let me know if I can somehow help out here, would be glad to support.

msvechla avatar Feb 12 '19 15:02 msvechla

Tried to replicate this yesterday, but I was unable to trigger it with a new project from scratch. I think what also might be confusing is that while docker prints all directives in the Dockerfile during the build process, img only shows filesystem operations?

At least the steps never showed directives like WORKDIR or ENTRYPOINT. So even when those directives did indeed work on other projects, they were not printed during the build process. Which makes it even harder to debug.

msvechla avatar Feb 13 '19 08:02 msvechla

@msvechla I haven't seen this happen, do you have a minimal dockerfile that reproduces the issue?

kekoav avatar Apr 27 '19 21:04 kekoav

I face this issue on my CI pipeline and was unable to reproduce it locally. Maybe this is something in the build environment?

nielsole avatar May 16 '19 16:05 nielsole

At least for us it this was a duplicate of https://github.com/genuinetools/img/issues/199 because we only ran into this after pushing and pulling the image

nielsole avatar May 17 '19 08:05 nielsole