This project supports building Fish Docker images in two ways:
- Package installation: Using pre-built Fish packages from Alpine repositories (faster)
- Binary installation: Installing prebuilt Fish binaries from GitHub releases (supports any released version)
- just (a modern
make-like system) - Docker with
buildxsupport
The build recipe takes the following arguments:
| Argument | Description | Default | Notes |
|---|---|---|---|
FISH_VERSION |
Fish version to build | required | e.g., "4.0.2", "4.1.1" |
ALPINE_VERSION |
Alpine base image version | required | e.g., "3.22", "edge" |
BUILD_USING_BINARY |
Build method | "false" | "true" for binary installation |
verbose |
Build output verbosity | "false" | "verbose" for detailed logs |
For Fish versions available in Alpine repositories:
# Build Fish 4.0.2 from Alpine 3.22 package
just build 4.0.2 3.22
# Build from binary with verbose output
just build 4.0.2 3.22 false verboseFor newer Fish versions not yet available in Alpine packages:
# Build Fish 4.2.1 from prebuilt binary
just build 4.2.1 edge true
# Build with verbose output
just build 4.2.1 edge true verboseVerify that the built image contains the expected Fish version:
# Test Fish 4.0.2 built on Alpine 3.22
just test 4.0.2 3.22The test command will:
- Show expected vs actual Fish versions with color coding
- Display ✓ VERSION MATCH for successful matches
- Display ✗ VERSION MISMATCH for failures
- Handle missing Docker images gracefully
When Alpine releases a new Fish package, add it to the GitHub Actions matrix in .github/workflows/build-images.yml:
{ fish: 4.0.7, alpine: "edge" }For newer Fish versions, use binary builds in the matrix:
{ fish: 4.2.0, alpine: "edge", binary: true }The build system will automatically:
- Download the binary archive from GitHub releases
- Compile Fish with all required dependencies (including Rust for newer versions)
- Create a Docker image with the specified Fish version
You can also build any Fish version locally:
# Build latest Fish from prebuilt binary
just build 4.2.1 edge true
# Build specific older version from package
just build 3.7.1 3.21 falseThe Dockerfile supports two installation methods controlled by the BUILD_USING_BINARY argument:
- Package method (
BUILD_USING_BINARY=false): Fast builds using Alpine's pre-built Fish packages - Binary method (
BUILD_USING_BINARY=true): Installs prebuilt Fish binaries from GitHub releases
The build process uses Docker multi-stage builds:
- Build stage: Downloads and extracts prebuilt Fish binaries from GitHub releases (when needed)
- Final stage: Creates minimal runtime image with Fish installed
When building from prebuilt binaries, the build stage temporarily installs:
- curl - for downloading the binary archive
- tar and xz - for extracting the compressed archive
These build dependencies are removed after extraction to keep the final image size minimal.
See RELEASE.md.