From 5fe984487322fc8c0cfd21323f009c50585ebdac Mon Sep 17 00:00:00 2001 From: Oh My Felix Date: Fri, 29 May 2026 07:58:47 +0000 Subject: [PATCH] chore: add CI rollout baseline --- .github/workflows/docker.yml | 117 +++++++++++++++++++++-------------- Makefile | 48 ++++++++++++++ README.md | 22 ++++--- 3 files changed, 131 insertions(+), 56 deletions(-) create mode 100644 Makefile diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e041b54..b91d604 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,66 +1,91 @@ -name: Docker +name: "Docker" on: + workflow_dispatch: + push: - branches: [master] + branches: ["master"] permissions: contents: read jobs: - docker: - runs-on: ubuntu-latest + test: + name: "Test (${{ matrix.version }})" + runs-on: "ubuntu-latest" strategy: matrix: - include: - #- version: "3.1" - #- version: "3.2" - #- version: "3.3" - #- version: "3.4" - #- version: "3.5" - #- version: "3.6" - - version: "3.7" - - version: "3.8" - - version: "3.9" - - version: "3.10" - - version: "3.11" - - version: "3.12" - - version: "3.13" - - version: "3.14" - - version: "3.15" - - version: "3.16" - - version: "3.17" - - version: "3.18" - - version: "3.19" - - version: "3.20" - - version: "3.21" - - version: "3.22" - - version: "edge" - + version: ["3.22", "3.21", "edge"] fail-fast: false - name: Docker (dockette/alpine:${{ matrix.version }}) - steps: - - name: Checkout + - name: "Checkout" uses: actions/checkout@v4 - - name: Login to DockerHub - uses: docker/login-action@v3 + - name: "Set up Docker Buildx" + uses: docker/setup-buildx-action@v3 + + - name: "Build image" + uses: docker/build-push-action@v6 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + context: "${{ matrix.version }}" + load: true + tags: "dockette/alpine:${{ matrix.version }}" - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - name: "Test image" + run: "make test VERSION=${{ matrix.version }}" - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + build: + name: "Build (${{ matrix.version }})" + needs: ["test"] + strategy: + matrix: + version: + #- "3.1" + #- "3.2" + #- "3.3" + #- "3.4" + #- "3.5" + #- "3.6" + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "3.13" + - "3.14" + - "3.15" + - "3.16" + - "3.17" + - "3.18" + - "3.19" + - "3.20" + - "3.21" + - "3.22" + - "edge" - - name: Build and push - uses: docker/build-push-action@v6 + fail-fast: false + uses: dockette/.github/.github/workflows/docker.yml@master + secrets: inherit + with: + image: "dockette/alpine" + tag: "${{ matrix.version }}" + context: "${{ matrix.version }}" + + docs: + name: "Docs" + runs-on: "ubuntu-latest" + needs: ["build"] + if: github.ref == 'refs/heads/master' + + steps: + - name: "Checkout" + uses: actions/checkout@v4 + + - name: "Update Docker Hub description" + uses: peter-evans/dockerhub-description@v5 with: - context: ./${{ matrix.version }} - push: true - tags: dockette/alpine:${{ matrix.version }} - platforms: linux/amd64,linux/arm64 + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: "dockette/alpine" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8e20bb3 --- /dev/null +++ b/Makefile @@ -0,0 +1,48 @@ +IMAGE ?= dockette/alpine +VERSION ?= 3.22 +TAG ?= $(VERSION) + +MAINTAINED_VERSIONS := 3.22 3.21 edge + +.PHONY: build test run $(addprefix build-,$(MAINTAINED_VERSIONS)) $(addprefix test-,$(MAINTAINED_VERSIONS)) $(addprefix run-,$(MAINTAINED_VERSIONS)) + +build: + docker build -t $(IMAGE):$(TAG) $(VERSION) + +test: + docker run --rm $(IMAGE):$(TAG) /bin/sh -c 'set -eu; \ + if [ "$(VERSION)" != "edge" ]; then grep -Eq "^$(VERSION)(\\.|$$)" /etc/alpine-release; else test -s /etc/alpine-release; fi; \ + test "$$(id -u dfx)" = "1000"; \ + test "$${USER_UID}" = "1000"; \ + test "$${USER_NAME}" = "dfx"; \ + test "$${USER_HOME}" = "/home/dfx"' + +run: + docker run --rm -it $(IMAGE):$(TAG) + +build-3.22: + $(MAKE) build VERSION=3.22 + +test-3.22: + $(MAKE) test VERSION=3.22 + +run-3.22: + $(MAKE) run VERSION=3.22 + +build-3.21: + $(MAKE) build VERSION=3.21 + +test-3.21: + $(MAKE) test VERSION=3.21 + +run-3.21: + $(MAKE) run VERSION=3.21 + +build-edge: + $(MAKE) build VERSION=edge + +test-edge: + $(MAKE) test VERSION=edge + +run-edge: + $(MAKE) run VERSION=edge diff --git a/README.md b/README.md index 0a4f035..20513c6 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,17 @@ -# Alpine +

Dockette / Alpine

-Base docker image based on Alpine Linux. +

+ GitHub Actions + Docker Hub pulls + GitHub Sponsors + Support/Discussions +

------ - -[![Docker Stars](https://img.shields.io/docker/stars/dockette/alpine.svg?style=flat)](https://hub.docker.com/r/dockette/alpine/) -[![Docker Pulls](https://img.shields.io/docker/pulls/dockette/alpine.svg?style=flat)](https://hub.docker.com/r/dockette/alpine/) +

+ Base docker image based on Alpine Linux. +

-## Discussion / Help - -[![Join the chat](https://img.shields.io/gitter/room/dockette/dockette.svg?style=flat-square)](https://gitter.im/contributte/contributte?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +----- ## Image @@ -25,7 +27,7 @@ Base docker image based on Alpine Linux. |--------|-------------------------|------------| | edge | `dockette/alpine:edge` | [edge](https://hub.docker.com/r/dockette/alpine) | | v3.22 | `dockette/alpine:v3.22` | [v3.22](https://hub.docker.com/r/dockette/alpine) | -| v3.21 | `dockette/alpine:v3.21` | [v3.20](https://hub.docker.com/r/dockette/alpine) | +| v3.21 | `dockette/alpine:v3.21` | [v3.21](https://hub.docker.com/r/dockette/alpine) | | v3.20 | `dockette/alpine:v3.20` | [v3.20](https://hub.docker.com/r/dockette/alpine) | | v3.19 | `dockette/alpine:v3.19` | [v3.19](https://hub.docker.com/r/dockette/alpine) | | v3.18 | `dockette/alpine:v3.18` | [v3.18](https://hub.docker.com/r/dockette/alpine) |