Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 71 additions & 46 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -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"
35 changes: 35 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# AGENTS.md

## Project

Dockette Alpine builds `dockette/alpine`, a family of Alpine Linux base images with a predefined `dfx` user. Each image exposes `USER_UID=1000`, `USER_NAME=dfx`, and `USER_HOME=/home/dfx`.

## Images

- Default image: `dockette/alpine:3.22` from build context `3.22/`.
- Maintained test targets in `Makefile`: `3.22`, `3.21`, and `edge`.
- Published tags in the workflow include `3.7` through `3.22` plus `edge`; older `3.1` through `3.6` Dockerfiles remain in the repo but are commented out in publishing.
- Each version directory is its own Docker build context and contains a matching `Dockerfile` based on `alpine:<version>` or `alpine:edge`.
- GitHub Actions builds and tests the maintained matrix, then publishes each configured version through the shared Dockette Docker workflow on `master`.

## Commands

- `make build` builds `${DOCKER_IMAGE}:${DOCKER_TAG}` from `${DOCKER_VERSION}`.
- `make test` runs the image and checks `/etc/alpine-release`, the `dfx` user, and exported user constants.
- `make run` opens an interactive shell in the current tag.
- `make build-3.22`, `make test-3.22`, and `make run-3.22` target Alpine 3.22 explicitly; equivalent targets exist for `3.21` and `edge`.

## Testing Notes

- Run `make test DOCKER_VERSION=<version> DOCKER_TAG=<version>` after changing a version Dockerfile.
- Use `make -n build test run` to dry-run command wiring without requiring Docker.
- The workflow currently passes `VERSION=...` to `make test`; this Makefile uses `DOCKER_VERSION`, so keep any workflow edits aligned with Makefile variable names.

## Guidelines

- Keep version directories, `Makefile` targets, README image table, and `.github/workflows/docker.yml` matrices aligned when adding or removing Alpine versions.
- Prefer `DOCKER_*` names for Docker-related Makefile variables.
- Place `.PHONY: <target>` directly above each Makefile target.
- Keep README badges and maintenance sections consistent with other Dockette image repos.
- Preserve the `dfx` user contract unless a coordinated breaking change is requested.
- Do not introduce unrelated formatting or structural changes.
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
59 changes: 59 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
DOCKER_IMAGE?=dockette/alpine
DOCKER_VERSION?=3.22
DOCKER_TAG?=${DOCKER_VERSION}

MAINTAINED_VERSIONS := 3.22 3.21 edge


.PHONY: build
build:
docker build -t ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_VERSION}

.PHONY: test
test:
docker run --rm ${DOCKER_IMAGE}:${DOCKER_TAG} /bin/sh -c 'set -eu; \
if [ "${DOCKER_VERSION}" != "edge" ]; then grep -Eq "^${DOCKER_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"'

.PHONY: run
run:
docker run --rm -it ${DOCKER_IMAGE}:${DOCKER_TAG}

.PHONY: build-3.22
build-3.22:
$(MAKE) build DOCKER_VERSION=3.22

.PHONY: test-3.22
test-3.22:
$(MAKE) test DOCKER_VERSION=3.22

.PHONY: run-3.22
run-3.22:
$(MAKE) run DOCKER_VERSION=3.22

.PHONY: build-3.21
build-3.21:
$(MAKE) build DOCKER_VERSION=3.21

.PHONY: test-3.21
test-3.21:
$(MAKE) test DOCKER_VERSION=3.21

.PHONY: run-3.21
run-3.21:
$(MAKE) run DOCKER_VERSION=3.21

.PHONY: build-edge
build-edge:
$(MAKE) build DOCKER_VERSION=edge

.PHONY: test-edge
test-edge:
$(MAKE) test DOCKER_VERSION=edge

.PHONY: run-edge
run-edge:
$(MAKE) run DOCKER_VERSION=edge
77 changes: 43 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Alpine
<h1 align=center>Dockette / Alpine</h1>

Base docker image based on Alpine Linux.
<p align=center>
<a href="https://github.com/dockette/alpine/actions"><img src="https://github.com/dockette/alpine/actions/workflows/docker.yml/badge.svg" alt="GitHub Actions"></a>
<a href="https://hub.docker.com/r/dockette/alpine"><img src="https://img.shields.io/docker/pulls/dockette/alpine.svg" alt="Docker Hub pulls"></a>
<a href="https://github.com/sponsors/f3l1x"><img src="https://img.shields.io/badge/sponsor-GitHub%20Sponsors-ea4aaa" alt="GitHub Sponsors"></a>
<a href="https://github.com/orgs/dockette/discussions"><img src="https://img.shields.io/badge/support-discussions-6f42c1" alt="Support/Discussions"></a>
</p>

-----

[![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/)
<p align=center>
Base docker image based on Alpine Linux.
</p>

## 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

Expand All @@ -21,31 +23,38 @@ Base docker image based on Alpine Linux.

## Usage

| Alpine | Image | Docker Hub |
|--------|-------------------------|------------|
| 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.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) |
| v3.17 | `dockette/alpine:v3.17` | [v3.17](https://hub.docker.com/r/dockette/alpine) |
| v3.16 | `dockette/alpine:v3.16` | [v3.16](https://hub.docker.com/r/dockette/alpine) |
| v3.15 | `dockette/alpine:v3.15` | [v3.15](https://hub.docker.com/r/dockette/alpine) |
| v3.14 | `dockette/alpine:v3.14` | [v3.14](https://hub.docker.com/r/dockette/alpine) |
| v3.13 | `dockette/alpine:v3.13` | [v3.13](https://hub.docker.com/r/dockette/alpine) |
| v3.12 | `dockette/alpine:v3.12` | [v3.12](https://hub.docker.com/r/dockette/alpine) |
| v3.11 | `dockette/alpine:v3.11` | [v3.11](https://hub.docker.com/r/dockette/alpine) |
| v3.10 | `dockette/alpine:v3.10` | [v3.10](https://hub.docker.com/r/dockette/alpine) |
| v3.9 | `dockette/alpine:v3.9` | [v3.9](https://hub.docker.com/r/dockette/alpine) |
| v3.8 | `dockette/alpine:v3.8` | [v3.8](https://hub.docker.com/r/dockette/alpine) |
| v3.7 | `dockette/alpine:v3.7` | [v3.7](https://hub.docker.com/r/dockette/alpine) |
| v3.6 | `dockette/alpine:v3.6` | [v3.6](https://hub.docker.com/r/dockette/alpine) |
| v3.5 | `dockette/alpine:v3.5` | [v3.5](https://hub.docker.com/r/dockette/alpine) |
| v3.4 | `dockette/alpine:v3.4` | [v3.4](https://hub.docker.com/r/dockette/alpine) |
| v3.3 | `dockette/alpine:v3.3` | [v3.3](https://hub.docker.com/r/dockette/alpine) |
| v3.2 | `dockette/alpine:v3.2` | [v3.2](https://hub.docker.com/r/dockette/alpine) |
| v3.1 | `dockette/alpine:v3.1` | [v3.1](https://hub.docker.com/r/dockette/alpine) |
The `edge` tag tracks Alpine edge. It is rolling and unstable, so prefer a pinned `3.x` tag for reproducible builds.

### Maintained Images

| Alpine | Image | Docker Hub |
|--------|------------------------|------------|
| edge | `dockette/alpine:edge` | [edge](https://hub.docker.com/r/dockette/alpine/tags?name=edge) |
| 3.22 | `dockette/alpine:3.22` | [3.22](https://hub.docker.com/r/dockette/alpine/tags?name=3.22) |
| 3.21 | `dockette/alpine:3.21` | [3.21](https://hub.docker.com/r/dockette/alpine/tags?name=3.21) |

### Legacy Images

These tags are published for compatibility, but are not part of the maintained test matrix.

| Alpine | Image | Docker Hub |
|--------|------------------------|------------|
| 3.20 | `dockette/alpine:3.20` | [3.20](https://hub.docker.com/r/dockette/alpine/tags?name=3.20) |
| 3.19 | `dockette/alpine:3.19` | [3.19](https://hub.docker.com/r/dockette/alpine/tags?name=3.19) |
| 3.18 | `dockette/alpine:3.18` | [3.18](https://hub.docker.com/r/dockette/alpine/tags?name=3.18) |
| 3.17 | `dockette/alpine:3.17` | [3.17](https://hub.docker.com/r/dockette/alpine/tags?name=3.17) |
| 3.16 | `dockette/alpine:3.16` | [3.16](https://hub.docker.com/r/dockette/alpine/tags?name=3.16) |
| 3.15 | `dockette/alpine:3.15` | [3.15](https://hub.docker.com/r/dockette/alpine/tags?name=3.15) |
| 3.14 | `dockette/alpine:3.14` | [3.14](https://hub.docker.com/r/dockette/alpine/tags?name=3.14) |
| 3.13 | `dockette/alpine:3.13` | [3.13](https://hub.docker.com/r/dockette/alpine/tags?name=3.13) |
| 3.12 | `dockette/alpine:3.12` | [3.12](https://hub.docker.com/r/dockette/alpine/tags?name=3.12) |
| 3.11 | `dockette/alpine:3.11` | [3.11](https://hub.docker.com/r/dockette/alpine/tags?name=3.11) |
| 3.10 | `dockette/alpine:3.10` | [3.10](https://hub.docker.com/r/dockette/alpine/tags?name=3.10) |
| 3.9 | `dockette/alpine:3.9` | [3.9](https://hub.docker.com/r/dockette/alpine/tags?name=3.9) |
| 3.8 | `dockette/alpine:3.8` | [3.8](https://hub.docker.com/r/dockette/alpine/tags?name=3.8) |
| 3.7 | `dockette/alpine:3.7` | [3.7](https://hub.docker.com/r/dockette/alpine/tags?name=3.7) |

Alpine `3.1` through `3.6` directories remain in this repository, but their tags are not published by the current workflow.

## Maintenance

Expand Down