From 5e0781103cc240747c427d095e29a35440fa2d28 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck Date: Tue, 7 Jan 2025 11:44:55 -0600 Subject: [PATCH] containers/download: Bump base, use new boto3 --- containers/services/download/Dockerfile | 17 +++++++++-------- containers/services/download/Makefile | 13 +++++-------- containers/services/download/VERSION | 2 ++ containers/services/download/requirements.txt | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 containers/services/download/VERSION diff --git a/containers/services/download/Dockerfile b/containers/services/download/Dockerfile index 04bd988f..5f30e53f 100644 --- a/containers/services/download/Dockerfile +++ b/containers/services/download/Dockerfile @@ -1,22 +1,23 @@ -FROM docker.io/alpine:3.15 +FROM docker.io/alpine:3.21 -MAINTAINER Haiku, Inc. -LABEL org.opencontainers.image.source https://github.com/haiku/infrastructure -LABEL org.opencontainers.image.url https://github.com/haiku/infrastructure/tree/master/containers/services/download -LABEL org.opencontainers.image.vendor Haiku, Inc. +LABEL org.opencontainers.image.source="https://github.com/haiku/infrastructure" +LABEL org.opencontainers.image.url="https://github.com/haiku/infrastructure/tree/main/containers/services/download" +LABEL org.opencontainers.image.authors="Haiku, Inc." +LABEL org.opencontainers.image.vendor="Haiku, Inc." +LABEL org.opencontainers.image.description="cgit Interface for Haiku" ADD requirements.txt / ADD entry.sh /entry.sh +# TODO: Maybe we want this container to pull the generate-download-pages repo at startup instead +# of at build time? RUN apk add --update python3 python3-dev py-pip git libgcc curl && \ - pip install -r /requirements.txt && \ + pip install --break-system-packages -r /requirements.txt && \ git clone https://github.com/haiku/generate-download-pages.git /generate-download-pages && \ mkdir /generate-download-pages/output && \ chmod 755 /entry.sh && \ chown -R nobody:nobody /generate-download-pages/output USER nobody - EXPOSE 8080 - CMD ["/entry.sh"] diff --git a/containers/services/download/Makefile b/containers/services/download/Makefile index 5aee11b9..3cfb95a8 100644 --- a/containers/services/download/Makefile +++ b/containers/services/download/Makefile @@ -1,11 +1,8 @@ -VERSION=20230910 +VERSION = $(shell cat VERSION | grep -Ev "^#" | tail -1)-development REGISTRY = ghcr.io/haiku default: - docker build --no-cache --tag ${REGISTRY}/download:$(VERSION) . + podman build --no-cache --tag ${REGISTRY}/download:${VERSION} . test: - docker run -d --name download-test -P ${REGISTRY}/download:$(VERSION) -clean: - docker stop download-test - docker rm download-test -push: - docker push ${REGISTRY}/download:$(VERSION) + docker kill download-test || true + podman run -d --replace --name download-test -v ./config.toml:/config.toml -e CONFIG_PATH=/config.toml -P ${REGISTRY}/download:$(VERSION) + @echo "http://`podman port download-test 8080 | sed 's/0.0.0.0/127.0.0.1/'`" diff --git a/containers/services/download/VERSION b/containers/services/download/VERSION new file mode 100644 index 00000000..5cf17216 --- /dev/null +++ b/containers/services/download/VERSION @@ -0,0 +1,2 @@ +# ONLY UPDATE ONCE READY TO BUILD NEW RELEASE +20250107 diff --git a/containers/services/download/requirements.txt b/containers/services/download/requirements.txt index d72ee85c..a47c521e 100644 --- a/containers/services/download/requirements.txt +++ b/containers/services/download/requirements.txt @@ -1,4 +1,4 @@ # packages required for the download generator script -boto +boto3 Mako toml