Skip to content

Building from source

Most people don't need to build iiiris. The released container image and release binaries are enough (see the README quick start). This page is for contributors, and for anyone running iiiris on a platform that has no release artifact (macOS, Windows without the MSI).

Requirements

  • Go 1.25+
  • libvips with OpenJPEG (for JP2 / HTJ2K support):
  • macOS: brew install vips
  • Debian/Ubuntu: apt-get install libvips-dev libopenjp2-7-dev pkg-config
  • Windows: MSYS2 UCRT64. See deployment.md.

Without libvips, only the pure-Go tests in internal/iiif/... and internal/cache/... run.

Build and run

make build           # → ./bin/iiirisd
./bin/iiirisd        # serves the bundled testdata/sample.jpg on :8080

Use make build (or go build -o bin/iiirisd ./cmd/iiirisd). A bare go build ./cmd/iiirisd drops the binary in the repo root.

Then:

curl http://localhost:8080/health
curl http://localhost:8080/iiif/3/sample.jpg/info.json
curl -o sample.jpg http://localhost:8080/iiif/3/sample.jpg/full/max/0/default.jpg

To turn on the admin UI at http://localhost:8080/admin/, set credentials:

IIIRIS_ADMIN_USER=admin IIIRIS_ADMIN_PASS=test ./bin/iiirisd

Docker compose (built from your checkout)

docker-compose.yml builds an image from the working tree and serves ./examples/images, a small corpus that demonstrates both the Image and the Presentation APIs:

cp .env.example .env
# edit .env: set a real IIIRIS_ADMIN_PASS
docker compose up --build

To demonstrate Redis-backed caching, add the overlay:

docker compose -f docker-compose.yml -f docker-compose.redis.yml up --build

See deployment.md for the full compose reference.

Make targets

make build           # build ./bin/iiirisd (with VERSION stamp from git describe)
make test            # go test -race ./...
make bench           # go test -bench=. ./...
make run             # go run ./cmd/iiirisd
make lint            # golangci-lint run
make docker          # build deploy/Dockerfile
make release-binary  # stripped, version-stamped, local-platform binary
make tidy            # go mod tidy

The comparative iiiris-vs-Cantaloupe benchmark is not a make target. Run it with bench/run.sh (locally or on AWS).

The bundled viewer

The Mirador bundle at internal/server/static/viewers/mirador.min.js is committed, so a normal build needs no Node. Rebuild it only when changing viewers/mirador/ (the iiiris annotation adapter or the pinned versions):

scripts/build-viewers.sh     # needs Docker; builds in a pinned Node image
scripts/vendor-viewers.sh    # checks the bundle against VERSIONS.md

Record the printed sha256 in internal/server/static/viewers/VERSIONS.md. CI's viewer-bundle-check job fails if the committed bundle doesn't match its sources.

Going further

  • deployment.md: build variants (debian-slim vs distroless images, release binaries), the Windows build and MSI, CI, and releases.
  • architecture.md: package map and request flow.
  • specs/: the contracts for shipped subsystems.
  • CLAUDE.md: working conventions for contributors.