From 0d667c7e92891b472e07e442c52f1d98c0efa8ec Mon Sep 17 00:00:00 2001 From: Alex Thomae Date: Sat, 27 Aug 2022 15:43:52 +0200 Subject: [PATCH 1/4] update docker to 6.0.0 --- cioban/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cioban/requirements.txt b/cioban/requirements.txt index 7c7b0e9..123468c 100644 --- a/cioban/requirements.txt +++ b/cioban/requirements.txt @@ -1,5 +1,5 @@ prometheus_client==0.14.1 -docker==5.0.3 +docker==6.0.0 pause==0.3 pygelf==0.4.2 ix-notifiers==0.0.259196408 From 3732b578364660abb44833a1ea01d66a8883d2e6 Mon Sep 17 00:00:00 2001 From: Alex Thomae Date: Sat, 27 Aug 2022 15:46:12 +0200 Subject: [PATCH 2/4] reenable builds for other platforms --- .gitlab-ci.yml | 3 +++ README.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4daa376..7c9511b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,9 @@ variables: DOCKERHUB_REPO_NAME: cioban GITHUB_REPO_NAME: ix-ai/cioban ENABLE_ARM64: 'true' + ENABLE_ARMv7: 'true' + ENABLE_ARMv6: 'true' + ENABLE_386: 'true' include: - project: ix.ai/ci-templates file: "/python-project.yml" diff --git a/README.md b/README.md index fe00f79..7a34935 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ The following labels are supported: ## Examples ### Start `registry.gitlab.com/ix.ai/cioban`as a Docker Swarm service + ```sh docker service create \ --name cioban \ @@ -141,6 +142,7 @@ networks: ### Prometheus metrics In addition to the metrics exporter by [prometheus/client_python/](https://github.com/prometheus/client_python/), the following metrics are exposed by cioban: + ``` # HELP update_run_seconds Time spent processing updates # TYPE update_run_seconds summary @@ -178,6 +180,7 @@ Please note, `armv7` and `armv6` are no longer available starting with version 0 * `dev-master` - the last build on the master branch ## Resources + * GitLab: https://gitlab.com/ix.ai/cioban * GitHub: https://github.com/ix-ai/cioban * GitLab Registry: `registry.gitlab.com/ix.ai/cioban` - https://gitlab.com/ix.ai/cioban/container_registry From e3a663833276f23531e074fbdf9103fd8f7b70aa Mon Sep 17 00:00:00 2001 From: Alex Thomae Date: Sat, 27 Aug 2022 16:20:38 +0200 Subject: [PATCH 3/4] Switch to alpine:latest --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f4da82c..27aa43c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker:latest +FROM alpine:latest LABEL maintainer="docker@ix.ai" \ ai.ix.repository="ix.ai/cioban" From 1b0429fd20eb9476e6683f72ab5da232e53c0784 Mon Sep 17 00:00:00 2001 From: Alex Thomae Date: Sat, 27 Aug 2022 16:47:04 +0200 Subject: [PATCH 4/4] switch to a manual build of pip deps --- Dockerfile | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27aa43c..9fd97be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,47 @@ +FROM alpine:latest as builder + +COPY cioban/requirements.txt /work/cioban/requirements.txt + +ENV CRYPTOGRAPHY_DONT_BUILD_RUST="1" + +RUN set -xeu; \ + mkdir -p /work/wheels; \ + apk add \ + python3-dev \ + openssl-dev \ + gcc \ + musl-dev \ + libffi-dev \ + make \ + openssl-dev \ + cargo \ + ; \ + python3 -m ensurepip; \ + pip3 install -U \ + wheel \ + pip + +RUN pip3 wheel --prefer-binary -r /work/cioban/requirements.txt -w /work/wheels + FROM alpine:latest + LABEL maintainer="docker@ix.ai" \ ai.ix.repository="ix.ai/cioban" -COPY cioban/requirements.txt /cioban/requirements.txt +COPY --from=builder /work / -RUN apk add --no-cache python3 py3-cryptography py3-pip && \ - pip3 install --no-cache-dir -r /cioban/requirements.txt +RUN set -xeu; \ + ls -lashi /wheels; \ + apk add --no-cache python3; \ + python3 -m ensurepip; \ + pip3 install --no-cache-dir -U pip;\ + pip3 install \ + --no-index \ + --no-cache-dir \ + --find-links /wheels \ + --requirement /cioban/requirements.txt \ + ; \ + rm -rf /wheels COPY cioban/ /cioban COPY cioban.sh /usr/local/bin/cioban.sh