| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ae7d3b0 commit 384031c
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,9 @@ | |||
| 1 | + .tox/ | ||
| 2 | + .venv/ | ||
| 1 | 3 | venv/ | |
| 2 | 4 | dist/ | |
| 3 | 5 | build/ | |
| 4 | 6 | *.egg-info | |
| 7 | + .coverage | ||
| 5 | 8 | .github/ | |
| 9 | + coverage.xml | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,26 +2,30 @@ image: python:3.10 | |||
| 2 | 2 | ||
| 3 | 3 | stages: | |
| 4 | 4 | - deploy | |
| 5 | - - deploy-latest | ||
| 5 | + - promote | ||
| 6 | 6 | ||
| 7 | - deploy_image: | ||
| 7 | + deploy-images: | ||
| 8 | 8 | stage: deploy | |
| 9 | 9 | image: | |
| 10 | 10 | name: gcr.io/kaniko-project/executor:debug | |
| 11 | 11 | entrypoint: [""] | |
| 12 | 12 | script: | |
| 13 | 13 | - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json | |
| 14 | - - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG | ||
| 15 | - only: | ||
| 16 | - - tags | ||
| 14 | + - executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-alpine | ||
| 15 | + - executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-slim-bullseye --build-arg PYTHON_FLAVOR=slim-bullseye | ||
| 16 | + rules: | ||
| 17 | + - if: $CI_COMMIT_TAG | ||
| 17 | 18 | ||
| 18 | - deploy-latest: | ||
| 19 | - stage: deploy-latest | ||
| 19 | + tag-latest: | ||
| 20 | + stage: promote | ||
| 20 | 21 | image: | |
| 21 | 22 | name: gcr.io/go-containerregistry/crane:debug | |
| 22 | 23 | entrypoint: [""] | |
| 23 | 24 | script: | |
| 24 | - - mkdir /root/.docker && echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /root/.docker/config.json | ||
| 25 | - - /ko-app/crane cp $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG $CI_REGISTRY_IMAGE:latest | ||
| 26 | - only: | ||
| 27 | - - tags | ||
| 25 | + - crane auth login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY | ||
| 26 | + - crane tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-alpine ${CI_COMMIT_TAG} # /python-gitlab:v1.2.3 | ||
| 27 | + - crane tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-alpine latest # /python-gitlab:latest | ||
| 28 | + - crane tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-alpine alpine # /python-gitlab:alpine | ||
| 29 | + - crane tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-slim-bullseye slim-bullseye # /python-gitlab:slim-bullseye | ||
| 30 | + rules: | ||
| 31 | + - if: $CI_COMMIT_TAG | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,10 +1,11 @@ | |||
| 1 | - FROM python:3.10-alpine AS build | ||
| 1 | + ARG PYTHON_FLAVOR=alpine | ||
| 2 | + FROM python:3.10-${PYTHON_FLAVOR} AS build | ||
| 2 | 3 | ||
| 3 | 4 | WORKDIR /opt/python-gitlab | |
| 4 | 5 | COPY . . | |
| 5 | 6 | RUN python setup.py bdist_wheel | |
| 6 | 7 | ||
| 7 | - FROM python:3.10-alpine | ||
| 8 | + FROM python:3.10-${PYTHON_FLAVOR} | ||
| 8 | 9 | ||
| 9 | 10 | WORKDIR /opt/python-gitlab | |
| 10 | 11 | COPY --from=build /opt/python-gitlab/dist dist/ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,8 +53,25 @@ From GitLab: | |||
| 53 | 53 | $ pip install git+https://gitlab.com/python-gitlab/python-gitlab.git | |
| 54 | 54 | ||
| 55 | 55 | ||
| 56 | - Using the docker image | ||
| 57 | - ---------------------- | ||
| 56 | + Using the docker images | ||
| 57 | + ----------------------- | ||
| 58 | + | ||
| 59 | + ``python-gitlab`` provides Docker images in two flavors, based on the Alpine and Debian slim | ||
| 60 | + python `base images <https://hub.docker.com/_/python>`__. The default tag is ``alpine``, | ||
| 61 | + but you can explicitly use the alias (see below). | ||
| 62 | + | ||
| 63 | + The alpine image is smaller, but you may want to use the Debian-based slim tag (currently | ||
| 64 | + based on ``-slim-bullseye``) if you are running into issues or need a more complete environment | ||
| 65 | + with a bash shell, such as in CI jobs. | ||
| 66 | + | ||
| 67 | + The images are published on the GitLab registry, for example: | ||
| 68 | + | ||
| 69 | + * ``registry.gitlab.com/python-gitlab/python-gitlab:latest`` (latest, alpine alias) | ||
| 70 | + * ``registry.gitlab.com/python-gitlab/python-gitlab:alpine`` (latest alpine) | ||
| 71 | + * ``registry.gitlab.com/python-gitlab/python-gitlab:slim-bullseye`` (latest slim-bullseye) | ||
| 72 | + * ``registry.gitlab.com/python-gitlab/python-gitlab:v3.2.0`` (alpine alias) | ||
| 73 | + * ``registry.gitlab.com/python-gitlab/python-gitlab:v3.2.0-alpine`` | ||
| 74 | + * ``registry.gitlab.com/python-gitlab/python-gitlab:v3.2.0-slim-bullseye`` | ||
| 58 | 75 | ||
| 59 | 76 | You can run the Docker image directly from the GitLab registry: | |
| 60 | 77 | ||
@@ -89,6 +106,12 @@ Run your own image: | |||
| 89 | 106 | ||
| 90 | 107 | $ docker run -it --rm -v python-gitlab:latest <command> ... | |
| 91 | 108 | ||
| 109 | + Build a Debian slim-based image: | ||
| 110 | + | ||
| 111 | + .. code-block:: console | ||
| 112 | + | ||
| 113 | + $ docker build -t python-gitlab:latest --build-arg PYTHON_FLAVOR=slim-bullseye . | ||
| 114 | + | ||
| 92 | 115 | Bug reports | |
| 93 | 116 | ----------- | |
| 94 | 117 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments