GITLAB entrypoint is not working . No arguments passed to entrypoint

I have my custom docker image on the gitlab registry which has an entrypoint python script that prints out the argument passed to the script.

I use this image in my test project’s ci pipeline . The image is run but the argument is not passed to and printed. The container works perfectly when ran locally via docker. I figure I am missing some thing in my gitlab ci yml. Please help “”

Below is the docker image created.

Below is the project I am testing the above image on.

I have tried changing the .gitlab-ci.yml in various ways . Doesnt work.

Dockerfile code :

FROM python:alpine3.7
COPY . /app
WORKDIR /app
ENTRYPOINT ["python", "test.py"]

Project using the above image:

stages:
  - build
build:
  image: registry.gitlab.com/raiyanyahya/docker-python-version
  stage: build
  script:
    - test

The build passes but i get unexpected results: Actual:

Running with gitlab-runner 12.1.0 (de7731dd)
  on docker-auto-scale fa6cab46
Using Docker executor with image registry.gitlab.com/raiyanyahya/docker-python-version ...
Authenticating with credentials from job payload (GitLab Registry)
Pulling docker image registry.gitlab.com/raiyanyahya/docker-python-version ...
Using docker image sha256:174111ca904169c5d8e395801d5d0455e127f41dc0a03ae134907157c62bfc08 for registry.gitlab.com/raiyanyahya/docker-python-version ...
Running on runner-fa6cab46-project-13759326-concurrent-0 via runner-fa6cab46-srm-1565485040-e61249f3...
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/raiyanyahya/test-docker-in-pipline/.git/
Created fresh repository.
From https://gitlab.com/raiyanyahya/test-docker-in-pipline
 * [new branch]      master     -> origin/master
Checking out 7c6bdafb as master...

Skipping Git submodules setup
Authenticating with credentials from job payload (GitLab Registry)
The input to the container is   sh
done !!
The input to the container is   sh
done !!
Job succeeded

Expected:

The input to the container is test.

Im also facing the same problem. found a solution? if yes, could you please share :slight_smile: