ENTRYPOINT just refuses to exec or even shell run

149 views Asked by At

This is my 3rd day of tear-your-hair-out since the weekend and I just cannot get ENTRYPOINT to work via gitlab runner 13.3.1, this for something that previously worked with a simple ENTRYPOINT ["/bin/bash"] but that was using local docker desktop and using docker run followed by docker exec commands which worked like a synch. Essentially, at the end of it all I previously got a WAR file built.

Currently I build my container in gitlab runner 13.3.1 and push to s3 bucket and then use the IMAGE:localhost:500/my-recently-builtcontainer and then try and do whatever it is I want with the container but I cannot even get ENTRYPOINT to work, in it's exec form or in shell form - atleast in the shell form I get to see something. In the exec form it just gave "OCI runtime create failed" opaque errors so I shifted to the shell form just to see where I could get to.

I keep getting

sh: 1: sh: echo HOME=/home/nonroot-user params=@$ pwd=/ whoami=nonroot-user script=sh ENTRYPOINT reached which_sh=/bin/sh which_bash=/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin; ls -alrth /bin/bash; ls -alrth /bin/sh; /usr/local/bin/entrypoint.sh ;: not found

In my Dockerfile I distinctly have

COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN bash -c "ls -larth /usr/local/bin/entrypoint.sh"

ENTRYPOINT "echo HOME=${HOME} params=@$ pwd=`pwd` whoami=`whoami` script=${0} ENTRYPOINT reached which_sh=`which sh` which_bash=`which bash` PATH=${PATH}; ls -alrth `which bash`; ls -alrth `which sh`; /usr/local/bin/lse-entrypoint.sh ;"

The output after I build the container in gitlab is - and I made sure anyone has rights to see this file and use it - just so that I can proceed with my work

-rwxrwxrwx 1 root root 512 Apr 11 17:40 /usr/local/bin/entrypoint.sh

So, I know it is there and all the chmod flags indicate anybody can look at it - so I am so perplexed why it is saying NOT FOUND

/usr/local/bin/entrypoint.sh ;: not found

entrypoint.sh is ...

#!/bin/sh
export PATH=$PATH:/usr/local/bin/

clear
echo Script is $0
echo numOfArgs is $#
echo paramtrsPassd is $@
echo whoami is `whoami`

bash --version
echo "About to exec ....."
exec "$@"

It does not even reach inside this entrypoint.sh file.

0

There are 0 answers