diff options
author | Max Wittig <max.wittig95@gmail.com> | 2018-10-05 19:00:41 +0200 |
---|---|---|
committer | Max Wittig <max.wittig@siemens.com> | 2018-10-09 13:16:50 +0200 |
commit | 06e8ca8747256632c8a159f760860b1ae8f2b7b5 (patch) | |
tree | 585bc59f2d3b5bf6610404b76972d7c027c8103c | |
parent | 3a8b1a0b11b9e6a60037f90c99dd288cecd09d3d (diff) | |
download | gitlab-fix/docker.tar.gz |
fix(docker): use docker image with current sourcesfix/docker
-rw-r--r-- | .dockerignore | 5 | ||||
-rw-r--r-- | Dockerfile | 16 | ||||
-rw-r--r-- | README.rst | 23 | ||||
-rw-r--r-- | contrib/docker/Dockerfile | 10 | ||||
-rw-r--r-- | contrib/docker/README.rst | 20 | ||||
-rwxr-xr-x | docker-entrypoint.sh (renamed from contrib/docker/entrypoint-python-gitlab.sh) | 0 |
6 files changed, 43 insertions, 31 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..204be74 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +venv/ +dist/ +build/ +*.egg-info +.github/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8c811b0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.7-alpine AS build + +WORKDIR /opt/python-gitlab +COPY . . +RUN python setup.py bdist_wheel + +FROM python:3.7-alpine + +WORKDIR /opt/python-gitlab +COPY --from=build /opt/python-gitlab/dist dist/ +RUN pip install $(find dist -name *.whl) && \ + rm -rf dist/ +COPY docker-entrypoint.sh /usr/local/bin/ + +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["--version"] @@ -20,7 +20,7 @@ It supports the v4 API of GitLab, and provides a CLI tool (``gitlab``). Maintainer(s) wanted ==================== -We are looking for neww maintainer(s) for this project. See +We are looking for new maintainer(s) for this project. See https://github.com/python-gitlab/python-gitlab/issues/596. Installation @@ -41,6 +41,27 @@ Install with pip pip install python-gitlab + +Using the python-gitlab docker image +==================================== + +How to build +------------ + +``docker build -t python-gitlab:TAG .`` + +How to use +---------- + +``docker run -it --rm -e GITLAB_PRIVATE_TOKEN=<your token> -v /path/to/python-gitlab.cfg:/python-gitlab.cfg python-gitlab <command> ...`` + +To change the GitLab URL, use `-e GITLAB_URL=<your url>` + + +Bring your own config file: +``docker run -it --rm -v /path/to/python-gitlab.cfg:/python-gitlab.cfg -e GITLAB_CFG=/python-gitlab.cfg python-gitlab <command> ...`` + + Bug reports =========== diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile deleted file mode 100644 index 6812c32..0000000 --- a/contrib/docker/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM python:alpine - -RUN pip install --upgrade python-gitlab - -COPY entrypoint-python-gitlab.sh /usr/local/bin/. - -WORKDIR /src - -ENTRYPOINT ["entrypoint-python-gitlab.sh"] -CMD ["--version"] diff --git a/contrib/docker/README.rst b/contrib/docker/README.rst deleted file mode 100644 index 1627661..0000000 --- a/contrib/docker/README.rst +++ /dev/null @@ -1,20 +0,0 @@ -python-gitlab docker image -========================== - -How to build ------------- - -``docker build -t python-gitlab:VERSION .`` - -How to use ----------- - -``docker run -it --rm -e GITLAB_PRIVATE_TOKEN=<your token> =/python-gitlab.cfg python-gitlab <command> ...`` - -To change the endpoint, add `-e GITLAB_URL=<your url>` - - -Bring your own config file: -``docker run -it --rm -v /path/to/python-gitlab.cfg:/python-gitlab.cfg -e GITLAB_CFG=/python-gitlab.cfg python-gitlab <command> ...`` - - diff --git a/contrib/docker/entrypoint-python-gitlab.sh b/docker-entrypoint.sh index 6422ad0..6422ad0 100755 --- a/contrib/docker/entrypoint-python-gitlab.sh +++ b/docker-entrypoint.sh |