Repository navigation
Conversation
Since 1ed154e, docker-compose builds artex:local from the local Dockerfile, but the Dockerfile still copied a prebuilt dist/<arch>/artex. dist/ is gitignored, so `docker compose up -d --build` on a fresh clone failed, and update.sh's Docker path rebuilt the image around whatever stale binary was left in dist/. Add two build stages that run the release workflow's own commands: the frontend static export (npm ci, npm run build:static on node 22), then ./build.sh --target linux/$TARGETARCH with ARTEX_SKIP_FRONTEND=1 and ARTEX_COMPRESS=0. ARTEX_VERSION is now declared as a build arg and fed to build.sh as ARTEX_BUILD_VERSION, so the compose arg sets main.version. Drop install.sh's dist/ warning, which no longer applies, and correct the update.sh menu text (it no longer pulls an image). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to 1ed154e ("fix: build the image locally instead of pulling a third-party namespace"). That commit got two things only partly done.
The two gaps
docker-compose.ymlbuildsartex:localfrom the local Dockerfile, but the Dockerfile still didCOPY dist/${TARGETARCH}/artex /app/artex./dist/is in.gitignore, so a fresh clone has no binary there, anddocker compose up -d --build(whatinstall.shruns) fails at that COPY.install.shonly printed a warning and then built anyway. (.dockerignoredoes not excludedist/, so the build worked for anyone who had built the binary by hand first.)update.shrunsgit pulland thendocker compose build artex, but nothing rebuiltdist/<arch>/artex. The new image wrapped whatever old binary was left indist/.There was also a loose end: compose passed
ARTEX_VERSIONas a build arg, but the Dockerfile never declared it.The change
web(node:22-bookworm-slim):npm ciandnpm run build:static, matching the releasefrontendjob.build(golang:1.26-bookworm):./build.sh --target linux/$TARGETARCHwithARTEX_SKIP_FRONTEND=1 ARTEX_COMPRESS=0, matching the releasebinariesjob. This keeps the same-tags embedui -trimpath -ldflags "-s -w -buildid= -X main.version=..."flags because it is the same script.ARG ARTEX_VERSION=devis now declared and passed tobuild.shasARTEX_BUILD_VERSION. The compose build arg now actually setsmain.version, so it stays in compose./out/artexfrom the build stage instead ofdist/.--platform=$BUILDPLATFORMand cross-compile, so multi-arch builds only emulate the runtime layers, the same as before.dist/warning, which no longer applies.docker compose build artexaftergit pullcompiles the pulled source. There is nodist/step left to keep in sync.docker-compose.yml,README.mdandrelease.ymlare unchanged. The releasedockerjob is off by default (DOCKERHUB_ENABLED). It still downloads binaries intodist/, which this Dockerfile now ignores, so that job builds from source too. Those download steps are now unused but harmless.Relation to #127
#127 (draft, currently conflicting with main) also adds frontend and Go build stages, as part of a larger rewrite: checksum-verified tool downloads, a pinned Node and Playwright, and a GHCR publish job. The build-stage part overlaps. This PR keeps to that part only and is written against main as it stands. It reuses
build.shrather than inlining ago build, so the image and the release binaries share one build definition. If #127 lands later, its Dockerfile supersedes this one.Verification
Run from a worktree of this branch (Kali WSL for Go and Docker, Windows for npm):
POSTGRES_PASSWORD=dummy docker compose -f docker-compose.yml configARTEX_VERSION: devbash -n install.sh/bash -n update.shgo build ./...webstage commands (npm ci, thenNEXT_EXPORT=1 next build)web/outproduced (run on Windows with Node 26, not node:22)buildstageRUNline, run verbatim withTARGETARCH=amd64 ARTEX_VERSION=v9.9.9-testand thatweb/outcopied intoserver/webui/distgo version -mshows-tags=embedui; the binary contains9.9.9-test(thevis stripped by build.sh, as for releases);artex -hrunsTARGETARCH=arm64Not verified
docker buildwas run. The Docker daemon available to me (in WSL) cannot reach Docker Hub, so it cannot pulldocker/dockerfile:1,node:22-bookworm-slim,golang:1.26-bookwormorpython:3.12-slim-bookworm. Docker Desktop on the Windows side was not running. Evendocker build --checkstopped at resolving the base images. What is untested is the Dockerfile wiring itself: theCOPYpaths between stages,$BUILDPLATFORM/$TARGETARCHhandling, andnpm ciunder node:22 (including the web package'sprepare: huskyscript, which also runs in CI whereweb/has no.git). Please rundocker compose build artexon a fresh clone before merging.This PR does not touch any live deployment: no containers were started, stopped or rebuilt, and no running stack was changed.
🤖 Generated with Claude Code