Skip to content

fix: create /app before writing version (build is broken on main)#2

Closed
jtrotsky wants to merge 1 commit into
daemonless:mainfrom
jtrotsky:fix/app-version-build
Closed

fix: create /app before writing version (build is broken on main)#2
jtrotsky wants to merge 1 commit into
daemonless:mainfrom
jtrotsky:fix/app-version-build

Conversation

@jtrotsky

Copy link
Copy Markdown
Contributor

The merged image fails to build. The npm RUN step redirects npm list -g @immich/cli --depth=0 | sed ... > /app/version, but nothing creates /app first, so the build dies with:

/bin/sh: cannot create /app/version: No such file or directory
Error: building at STEP "RUN pkg update && pkg install ...": exit status 2

This fixes it:

  • mkdir -p /app before writing the version file.
  • sed -n 's/.*@//p' instead of sed 's/.*@//'npm list -g prints the prefix path (/usr/local/lib) as its first line, which leaked into the version string and produced a two-line /app/version. The -n ... p form emits only the @immich/cli@… line.
  • chmod /app alongside node_modules so the unprivileged bsd user can read /app/version at runtime.

Changes are in Containerfile.j2 (source) and the generated Containerfile.

Verified locally: dbuild build completes and the version probe reports 2.7.5.

The build failed at the npm RUN step: it redirected `npm list ... >
/app/version` but nothing created /app, so the shell errored with
"cannot create /app/version: No such file or directory".

- mkdir -p /app before writing the version file
- sed -n 's/.*@//p' so only the @immich/cli line is emitted (npm list
  prints the prefix path as its first line, which otherwise leaked into
  the version string)
- chmod /app world-readable so the unprivileged bsd user can read
  /app/version at runtime

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jtrotsky jtrotsky closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant