Skip to content

Commit

Permalink
Chainguard wolfi-base image as base for docker (#68)
Browse files Browse the repository at this point in the history
* wolfi-base as containing image

* add dll setup

* fix missing dll package in wolfi image

* fix hadolint issues

* fix missing logger key

* packages in one line

* older harborapi version as new version breaks

* downgrade harborapi version

* downgrade harborapi version

* remove option user pip

* remove cache clean and add pip back in

* newer harborapi version

* temporal fix of harborapi explicitly setting httpx version
  • Loading branch information
peters-david authored Dec 18, 2024
1 parent 8558afb commit 9ee4cee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM python:3.12-alpine@sha256:5049c050bdc68575a10bcb1885baa0689b6c15152d8a56a7e399fb49f783bf98 AS base
# Always use the latest image
# hadolint ignore=DL3007
FROM cgr.dev/chainguard/wolfi-base:latest AS base
ENV PYTHONUNBUFFERED=1

FROM base AS builder
# we want always the latest version of fetched apk packages
# hadolint ignore=DL3018
RUN apk add --no-cache build-base libressl-dev musl-dev libffi-dev && \
RUN apk add --no-cache build-base openssl-dev glibc-dev posix-libc-utils libffi-dev \
python-3.12 python3-dev py3.12-pip && \
mkdir /install
WORKDIR /install
COPY requirements.txt requirements.txt
Expand All @@ -31,5 +34,7 @@ COPY tests/ /tests/
WORKDIR /tests
RUN python3 -m unittest discover -v -s .

FROM alpine:3.20@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a
# Always use the latest image
# hadolint ignore=DL3007
FROM cgr.dev/chainguard/wolfi-base:latest
COPY --from=native-builder /install/harbor.bin /usr/local/harbor
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
harborapi==0.26.1
python-json-logger==2.0.7
chevron==0.14.0
httpx==0.27.2 # temporal fix of harborapi
5 changes: 4 additions & 1 deletion src/registries.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,8 @@ async def sync_registries(client, path, logger):
)
# Create new registry
else:
logger.info("Creating new registry", extra={target_registry_name})
logger.info(
"Creating new registry",
extra={"registry": target_registry_name}
)
await client.create_registry(registry=target_registry)

0 comments on commit 9ee4cee

Please sign in to comment.