From c488c77616a0bed8a6bb7ee451aa4aac2dcf40ad Mon Sep 17 00:00:00 2001 From: Dominic Ricottone Date: Thu, 28 Mar 2024 14:53:03 -0500 Subject: [PATCH] Update apkbuilder Update version to 3.19. Laying groundwork for multiple supported versions of Alpine in apkbuilder. --- README.md | 2 +- apkbuilder/{Dockerfile => Dockerfile.3.18} | 4 ++-- apkbuilder/Dockerfile.3.19 | 27 ++++++++++++++++++++++ apkbuilder/Makefile | 20 ++++++++++++---- apkbuilder/README.md | 4 +++- 5 files changed, 48 insertions(+), 9 deletions(-) rename apkbuilder/{Dockerfile => Dockerfile.3.18} (88%) create mode 100644 apkbuilder/Dockerfile.3.19 diff --git a/README.md b/README.md index d763a73..aa5f425 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ It should be easy to get things working on another build system. |Images |Tags |Fully qualified name of the default image| |:------|:----|:----------------------------------------| -|[apkbuilder](/~dricottone/container-images/tree/dev/item/apkbuilder/README.md)|latest|`registry.intra.dominic-ricottone.com/apkbuilder:latest`| +|[apkbuilder](/~dricottone/container-images/tree/dev/item/apkbuilder/README.md)|latest,3.18,3.19|`registry.intra.dominic-ricottone.com/apkbuilder:latest`| |[dnsmasq](/~dricottone/container-images/tree/dev/item/dnsmasq/README.md)|latest|`registry.intra.dominic-ricottone.com/dnsmasq:latest`| |[fcgi](/~dricottone/container-images/tree/dev/item/fcgi/README.md)|latest|`registry.intra.dominic-ricottone.com/fcgi:latest`| |[grafana](/~dricottone/container-images/tree/dev/item/grafana/README.md)|latest|`registry.intra.dominic-ricottone.com/grafana:latest`| diff --git a/apkbuilder/Dockerfile b/apkbuilder/Dockerfile.3.18 similarity index 88% rename from apkbuilder/Dockerfile rename to apkbuilder/Dockerfile.3.18 index f24f6f5..adee4cc 100644 --- a/apkbuilder/Dockerfile +++ b/apkbuilder/Dockerfile.3.18 @@ -1,4 +1,4 @@ -FROM docker.io/library/alpine:3.17 +FROM docker.io/library/alpine:3.18 RUN adduser -D builder && addgroup builder abuild @@ -15,7 +15,7 @@ RUN echo "builder ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers COPY abuild/*.rsa.pub /etc/apk/keys/ RUN chmod 644 /etc/apk/keys/*.rsa.pub RUN mv /etc/apk/repositories /etc/apk/repositories.bak -RUN echo "https://pkg.intra.dominic-ricottone.com/alpine/v3.17" | cat - /etc/apk/repositories.bak >/etc/apk/repositories +RUN echo "https://pkg.intra.dominic-ricottone.com/alpine/v3.18" | cat - /etc/apk/repositories.bak >/etc/apk/repositories USER builder WORKDIR /home/builder diff --git a/apkbuilder/Dockerfile.3.19 b/apkbuilder/Dockerfile.3.19 new file mode 100644 index 0000000..06bcca8 --- /dev/null +++ b/apkbuilder/Dockerfile.3.19 @@ -0,0 +1,27 @@ +FROM docker.io/library/alpine:3.19 + +RUN adduser -D builder && addgroup builder abuild + +# packaging script +COPY --chown=builder:builder build.sh /home/builder/build.sh +RUN chmod 755 /home/builder/build.sh + +# packaging configuration +COPY --chown=builder:builder abuild /home/builder/.abuild +RUN chmod 600 /home/builder/.abuild/* + +RUN apk add --no-cache abuild sudo +RUN echo "builder ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers +COPY abuild/*.rsa.pub /etc/apk/keys/ +RUN chmod 644 /etc/apk/keys/*.rsa.pub +RUN mv /etc/apk/repositories /etc/apk/repositories.bak +RUN echo "https://pkg.intra.dominic-ricottone.com/alpine/v3.19" | cat - /etc/apk/repositories.bak >/etc/apk/repositories + +USER builder +WORKDIR /home/builder +RUN mkdir -p /home/builder/packages +VOLUME /home/builder/packages/src +VOLUME /home/builder/src +ENTRYPOINT ["/home/builder/build.sh"] +CMD ["non_existant_package_name"] + diff --git a/apkbuilder/Makefile b/apkbuilder/Makefile index 3d1500d..301d6e7 100644 --- a/apkbuilder/Makefile +++ b/apkbuilder/Makefile @@ -2,12 +2,22 @@ CONMAN=sudo docker REGISTRY=registry.intra.dominic-ricottone.com IMAGE=apkbuilder -TAG=latest +TAG_NUM_LATEST=3.19 +TAG_NUM_LEGACY=3.18 -image: +image: image-legacy image-latest + +image-legacy: + $(CONMAN) buildx build --push \ + --platform linux/arm64,linux/amd64 \ + --tag $(REGISTRY)/$(IMAGE):$(TAG_NUM_LEGACY) \ + . -f Dockerfile.3.18 + +image-latest: $(CONMAN) buildx build --push \ --platform linux/arm64,linux/amd64 \ - --tag $(REGISTRY)/$(IMAGE):$(TAG) \ - . + --tag $(REGISTRY)/$(IMAGE):$(TAG_NUM_LATEST) \ + --tag $(REGISTRY)/$(IMAGE):latest \ + . -f Dockerfile.3.19 -.PHONY: image +.PHONY: image image-legacy image-latest diff --git a/apkbuilder/README.md b/apkbuilder/README.md index d934915..b057a22 100644 --- a/apkbuilder/README.md +++ b/apkbuilder/README.md @@ -10,7 +10,9 @@ make image ### Tags - + `latest` + + `latest` (alias to `19`) + + `19` (for Alpine release 3.19) + + `18` (for Alpine release 3.18) ---- -- 2.45.2