-
Notifications
You must be signed in to change notification settings - Fork 671
docker image for python-gitlab #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, I don't know if there's a python-gitlab image, but it's not something I want to maintain myself. If someone wants to do the initial work and make sure it is maintained, I'd be happy to host the code in the python-gitlab/ namespace. |
Ok, if I succeed in making a working image, I will use it on a daily basis, so I'm sure I'll be maintaining it. So I'll get back on this issue once I get a working image. |
The docker image is now ready. Here is the Dockerfile: FROM debian:stretch-slim
# Install dependencies
RUN apt update && \
apt install -y \
python-pip
# Install python-gitlab
RUN pip install --upgrade \
python-gitlab
# Copy sample configuration file
COPY python-gitlab.cfg /python-gitlab/python-gitlab.cfg
# Define the entrypoint that enable a configuration file
ENTRYPOINT ["gitlab", "--config-file", "/python-gitlab/python-gitlab.cfg"] Here is the sample configuration file that I included in my own image via the [global]
default = somewhere
ssl_verify = true
timeout = 5
api_version = 3
[somewhere]
url = https://some.whe.re
private_token = vTbFeqJYCY3sibBP7BZM
api_version = 4
[elsewhere]
url = http://else.whe.re:8080
private_token = CkqsjqcQSFH5FQKDccu4
timeout = 1 You'll have to provide your own configuration file on the command line: docker run -it -v /path/to/my/configuration/of/python-gitlab.cfg:/python-gitlab/python-gitlab.cfg python-gitlab <my command> Which could lead to: docker run -it -v /path/to/my/configuration/of/python-gitlab.cfg:/python-gitlab/python-gitlab.cfg python-gitlab project list You can register this command as an alias: alias gitlab='docker run --rm -it -v /path/to/my/configuration/of/python-gitlab.cfg:/python-gitlab/python-gitlab.cfg python-gitlab' Which could lead to: gitlab project list I'm using this image successfully as CLI. There some more work to achieve in order to use the API. Could you please reopen the bug for the moment? And feel free to merge these materials within the git repository, or in another one. It would be greate to enable automatic build and publication to the docker hub. |
Thanks for this Dockerfile. A couple questions about your choices:
|
@oupala any feedback on the previous comment? |
Sorry for the delay and thanks @gpocentek for your comments. You're right for both of them. I now use a Here is the Dockerfile: FROM python:slim
# Install python-gitlab
RUN pip install --upgrade python-gitlab
# Copy sample configuration file
COPY python-gitlab.cfg /
# Define the entrypoint that enable a configuration file
ENTRYPOINT ["gitlab", "--config-file", "/python-gitlab.cfg"] Here is the sample configuration file that I included in my own image via the [global]
default = somewhere
ssl_verify = true
timeout = 5
api_version = 3
[somewhere]
url = https://some.whe.re
private_token = vTbFeqJYCY3sibBP7BZM
api_version = 4
[elsewhere]
url = http://else.whe.re:8080
private_token = CkqsjqcQSFH5FQKDccu4
timeout = 1 You'll have to provide your own configuration file on the command line: docker run -it -v /path/to/my/configuration/of/python-gitlab.cfg:/python-gitlab.cfg python-gitlab <my command> Which could lead to: docker run -it -v /path/to/my/configuration/of/python-gitlab.cfg:/python-gitlab.cfg python-gitlab project list You can register this command as an alias: alias gitlab='docker run --rm -it -v /path/to/my/configuration/of/python-gitlab.cfg:/python-gitlab.cfg python-gitlab' Which could lead to: gitlab project list I'm using this image successfully as CLI. There some more work to achieve in order to use the API. Feel free to merge these materials within the git repository, or in another one. It would be greate to enable automatic build and publication to the docker hub. |
@oupala Thanks for the update. I have limited time to work on python-gitlab so for now I don't want to add the docker image maintenance to my ToDo list. I've added your Dockerfile and a README to the source code to make it available to the world. Thank you! |
Great! Thanks. |
Is there a docker image for python-gitlab ?
If not, it could be a good thing to get python-gitlab available as a docker image.
The text was updated successfully, but these errors were encountered: