Docker image entrypoint not respected

I created a dockerized python command line tool and want to run it with gitlab ci.
But gitlab CI doesn’t seem to respect the entrypoint of the container and returns an error:

/bin/sh: eval: line 109: update: not found

The python cli tool is executed as follows:

python3 my_cli.py update --host-url my.example.url

The dockerfile is defined with an entrypoint:

FROM python:3.9.1-alpine
WORKDIR /cli
COPY requirements.txt . 
COPY my_cli.py .
RUN pip3 install -r requirements.txt
ENTRYPOINT [ "python3", "my_cli.py" ]

The entrypoint allows to run the tool with docker as follows:

docker run my-cli-container update --host-url my.example.url

I was expecting that I can run the tool the same way in gitlab ci:

My gitlab ci job:
  image: 
    name: my-image-from-private-registry:0.0.1
  script:
    - update --sonar-host-url <host_url>

/bin/sh: eval: line 109: update: not found

Modifying the entrypoint in gitlab ci also resulted in the same error:

My gitlab ci job:
  image: 
    name: my-image-from-private-registry:0.0.1
    entrypoint: [ "python3", "my_cli.py" ]
  script:
    - update --sonar-host-url <host_url>

/bin/sh: eval: line 109: update: not found

I was expecting that gitlab ci would run the command same like docker. But it seems it overwrites the entrypoint to start a shell.
But even when I specify the entrypoint in the gitlab ci file, I would expect that the entrypoint would be overwritten as stated in the documentation: Using Docker images | GitLab

Where can I find more information on how gitlab runner is executing containers and is this the expected behaviour?

  • Gitlab self hosted version: 12.10.1
  • Gitlab runner: 11.6.0