Skip to content

Commit 06e8ca8

Browse files
committed
fix(docker): use docker image with current sources
1 parent 3a8b1a0 commit 06e8ca8

File tree

6 files changed

+43
-31
lines changed

6 files changed

+43
-31
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
venv/
2+
dist/
3+
build/
4+
*.egg-info
5+
.github/

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM python:3.7-alpine AS build
2+
3+
WORKDIR /opt/python-gitlab
4+
COPY . .
5+
RUN python setup.py bdist_wheel
6+
7+
FROM python:3.7-alpine
8+
9+
WORKDIR /opt/python-gitlab
10+
COPY --from=build /opt/python-gitlab/dist dist/
11+
RUN pip install $(find dist -name *.whl) && \
12+
rm -rf dist/
13+
COPY docker-entrypoint.sh /usr/local/bin/
14+
15+
ENTRYPOINT ["docker-entrypoint.sh"]
16+
CMD ["--version"]

README.rst

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ It supports the v4 API of GitLab, and provides a CLI tool (``gitlab``).
2020
Maintainer(s) wanted
2121
====================
2222

23-
We are looking for neww maintainer(s) for this project. See
23+
We are looking for new maintainer(s) for this project. See
2424
https://github.com/python-gitlab/python-gitlab/issues/596.
2525

2626
Installation
@@ -41,6 +41,27 @@ Install with pip
4141
4242
pip install python-gitlab
4343
44+
45+
Using the python-gitlab docker image
46+
====================================
47+
48+
How to build
49+
------------
50+
51+
``docker build -t python-gitlab:TAG .``
52+
53+
How to use
54+
----------
55+
56+
``docker run -it --rm -e GITLAB_PRIVATE_TOKEN=<your token> -v /path/to/python-gitlab.cfg:/python-gitlab.cfg python-gitlab <command> ...``
57+
58+
To change the GitLab URL, use `-e GITLAB_URL=<your url>`
59+
60+
61+
Bring your own config file:
62+
``docker run -it --rm -v /path/to/python-gitlab.cfg:/python-gitlab.cfg -e GITLAB_CFG=/python-gitlab.cfg python-gitlab <command> ...``
63+
64+
4465
Bug reports
4566
===========
4667

contrib/docker/Dockerfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

contrib/docker/README.rst

Lines changed: 0 additions & 20 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)