Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Usage of Docker image with Gitlab CI?#2822

Answeredbyeddybl
eddybl asked this question inQ&A
Discussion options

I was wondering if I can use the official docker images as animage in a Gitlab job configuration. I tried this:

Test:image:registry.gitlab.com/python-gitlab/python-gitlab:v4.4.0-slim-bullseyescript:    -gitlab --help

but the pipeline fails:

Executing "step_script" stage of the job scriptUsing docker image sha256:375413e02421a39fc96f8e374408cf51419e88bb63e1904d710c66d35d2c83b7 for registry.gitlab.com/python-gitlab/python-gitlab:v4.4.0-slim-bullseye with digest registry.gitlab.com/python-gitlab/python-gitlab@sha256:680adaa1ea9220b276d5e202590738d1fb19150ec3b934c41eeb6d5e1b96fabb ...Cannot read config from file: [Errno 2] No such file or directory: 'if [ -x 'ERROR: Job failed: exit code 1

Or should I rather go for a default Python slim image and install thepython-gitlab module on the fly?

You must be logged in to vote

Well, as is often the case once you write down your problem I was now able to fix it.

I was already aware that the entrypoint is most likely the issue and the official GitLab documentation explains in detail how to circumvent this problem:https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#override-the-entrypoint-of-an-image

so the solution for this case is:

Test:image:name:registry.gitlab.com/python-gitlab/python-gitlab:v4.4.0-slim-bullseyeentrypoint:[""]script:    -gitlab --help

and this then works as expected.

Replies: 2 comments

Comment options

I think the image takes as its arguments the arguments to thegitlab command.

podman run -it registry.gitlab.com/python-gitlab/python-gitlab:v4.4.0-slim-bullseye user --helpusage: gitlab user [-h]  list  get  create  update  delete  block  follow  unfollow  unblock  deactivate  activate  approve  reject  ban  unban             ...options:  -h, --help            show this help message and exitaction:  list  get  create  update  delete  block  follow  unfollow  unblock  deactivate  activate  approve  reject  ban  unban                        Action to execute on the GitLab resource.

That is the most I have ever used the image though. So I'm not much help.

You must be logged in to vote
0 replies
Comment options

Well, as is often the case once you write down your problem I was now able to fix it.

I was already aware that the entrypoint is most likely the issue and the official GitLab documentation explains in detail how to circumvent this problem:https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#override-the-entrypoint-of-an-image

so the solution for this case is:

Test:image:name:registry.gitlab.com/python-gitlab/python-gitlab:v4.4.0-slim-bullseyeentrypoint:[""]script:    -gitlab --help

and this then works as expected.

You must be logged in to vote
0 replies
Answer selected byeddybl
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@eddybl@JohnVillalovos

[8]ページ先頭

©2009-2025 Movatter.jp