Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gitlab-runner gitlab-runner
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,478
    • Issues 2,478
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 123
    • Merge requests 123
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • gitlab-runnergitlab-runner
  • Issues
  • #2338
Closed
Open
Created Apr 07, 2017 by Assen Todorov@assen.todorov

Kubernetes executor does not invoke the ENTRYPOINT script of the defined image in .gitlab-ci.yml

Summary

Kubernetes executor does not invoke the script defined as ENTRYPOINT in a Docker image defined in image in .gitlab-ci.yml

Steps to reproduce

  • Write small bash script entry-point.sh like this:

entry-point.sh

#!/bin/bash
echo "#################################"
echo "The ENTRYPOINT script was executed."
echo "#################################"
  • Set up a Docker image with defined ENTRYPOINT script like this

Dockerfile

FROM ubuntu:latest
COPY entry-point.sh /bin
RUN chmod +x /bin/entry-point.sh
ENTRYPOINT ["/bin/entry-point.sh"]
CMD ["/bin/bash"]
  • Create docker image and push it in some public registry
docker build -t k8s-executor-entry-point .
  • Set this image as image in a .gitlab-ci.yml

.gitlab-ci.yml

image: eu.gcr.io/build-registry/k8s-executor-entry-point
stages:
  - build
build:
  stage: build
  script:
    - echo "Build finished"
  • Run the pipeline

Actual behavior

The ENTRYPOINT script does not get executed.

Running with gitlab-ci-multi-runner 9.0.2 (fa8b86d)
  on Kubernetes Runner (8fdecba6)
Using Kubernetes namespace: gitlab
Using Kubernetes executor with image eu.gcr.io/build-registry/k8s-executor-entry-point ...
Waiting for pod gitlab/runner-8fdecba6-project-29-concurrent-08x3zq to be running, status is Pending
Running on runner-8fdecba6-project-29-concurrent-08x3zq via specific-runner-2065590519-3tcs0...
Cloning repository...
Cloning into '/knowledge/test-project'...
Checking out 6617a96d as master...
Skipping Git submodules setup
$ echo "Build finished"
Build finished
Job succeeded

Expected behavior

The script defined as ENTRYPOINT schould be executed.

Running with gitlab-ci-multi-runner 9.0.2 (fa8b86d)
  on Kubernetes Runner (8fdecba6)
Using Kubernetes namespace: gitlab
Using Kubernetes executor with image eu.gcr.io/build-registry/k8s-executor-entry-point ...
Waiting for pod gitlab/runner-8fdecba6-project-29-concurrent-030wkt to be running, status is Pending
Running on runner-8fdecba6-project-29-concurrent-030wkt via specific-runner-2065590519-3tcs0...
Cloning repository...
Cloning into '/knowledge/test-project'...
Checking out 1f46d3fb as master...
Skipping Git submodules setup
#################################
The ENTRYPOINT script was executed.
#################################
$ echo "Build finished"
Build finished
Job succeeded

Relevant logs and/or screenshots

Running with gitlab-ci-multi-runner 9.0.2 (fa8b86d)
  on Kubernetes Runner (8fdecba6)
Using Kubernetes namespace: gitlab
Using Kubernetes executor with image eu.gcr.io/build-registry/k8s-executor-entry-point ...
Waiting for pod gitlab/runner-8fdecba6-project-29-concurrent-08x3zq to be running, status is Pending
Running on runner-8fdecba6-project-29-concurrent-08x3zq via specific-runner-2065590519-3tcs0...
Cloning repository...
Cloning into '/knowledge/test-project'...
Checking out 6617a96d as master...
Skipping Git submodules setup
$ echo "Build finished"
Build finished
Job succeeded

Environment description

Custom installation running on Kubernetes cluster

Used GitLab Runner version

Running with gitlab-ci-multi-runner 9.0.2 (fa8b86d)
  on Kubernetes Runner (8fdecba6)
Using Kubernetes namespace: gitlab
Using Kubernetes executor with image eu.gcr.io/build-registry/k8s-executor-entry-point ...
Assignee
Assign to
Time tracking