File tree Expand file tree Collapse file tree 4 files changed +35
-28
lines changed
Expand file tree Collapse file tree 4 files changed +35
-28
lines changed Original file line number Diff line number Diff line change 1- FROM python:slim
1+ FROM python:alpine
22
3- # Install python-gitlab
43RUN pip install --upgrade python-gitlab
54
6- # Copy sample configuration file
7- COPY python-gitlab.cfg /
5+ COPY entrypoint-python-gitlab.sh /usr/local/bin/.
86
9- # Define the entrypoint that enable a configuration file
10- ENTRYPOINT ["gitlab" , "--config-file" , "/python-gitlab.cfg" ]
7+ WORKDIR /src
8+
9+ ENTRYPOINT ["entrypoint-python-gitlab.sh" ]
10+ CMD ["--version" ]
Original file line number Diff line number Diff line change 11python-gitlab docker image
22==========================
33
4- Dockerfile contributed by *oupala *:
5- https://github.com/python-gitlab/python-gitlab/issues/295
6-
74How to build
85------------
96
10- ``docker build -t me/ python-gitlab:VERSION . ``
7+ ``docker build -t python-gitlab:VERSION . ``
118
129How to use
1310----------
1411
15- ``docker run -it -v /path/to/python-gitlab.cfg:/python-gitlab.cfg python-gitlab <command> ... ``
12+ ``docker run -it --rm -e GITLAB_PRIVATE_TOKEN=<your token> =/python-gitlab.cfg python-gitlab <command> ... ``
13+
14+ To change the endpoint, add `-e GITLAB_URL=<your url> `
15+
16+
17+ Bring your own config file:
18+ ``docker run -it --rm -v /path/to/python-gitlab.cfg:/python-gitlab.cfg -e GITLAB_CFG=/python-gitlab.cfg python-gitlab <command> ... ``
1619
17- To make things easier you can create a shell alias:
1820
19- ``alias gitlab='docker run --rm -it -v /path/to/python-gitlab.cfg:/python-gitlab.cfg python-gitlab ``
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ GITLAB_CFG=${GITLAB_CFG:- " /etc/python-gitlab-default.cfg" }
4+
5+ cat << EOF > /etc/python-gitlab-default.cfg
6+ [global]
7+ default = gitlab
8+ ssl_verify = ${GITLAB_SSL_VERIFY:- true}
9+ timeout = ${GITLAB_TIMEOUT:- 5}
10+ api_version = ${GITLAB_API_VERSION:- 4}
11+ per_page = ${GITLAB_PER_PAGE:- 10}
12+
13+ [gitlab]
14+ url = ${GITLAB_URL:- https:// gitlab.com}
15+ private_token = ${GITLAB_PRIVATE_TOKEN}
16+ oauth_token = ${GITLAB_OAUTH_TOKEN}
17+ http_username = ${GITLAB_HTTP_USERNAME}
18+ http_password = ${GITLAB_HTTP_PASSWORD}
19+ EOF
20+
21+ exec gitlab --config-file " ${GITLAB_CFG} " $@
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments