photoprism-photoprism
SUCCESS
20m 38s
History Source
SummaryIterations1Transcript13Dockerfile
01Iteration 1
WRITEWriteFile· step #1
1s
Dockerfile1305 bytes written
text55 lines · 1305 chars
# Stage 1: Builder
FROM ubuntu:noble-20260210.1 AS builder

ENV DEBIAN_FRONTEND=noninteractive

# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    curl \
    git \
    build-essential \
    pkg-config \
    libjpeg-dev libpng-dev libwebp-dev \
    libx11-dev libgl1-mesa-dev \
    && rm -rf /var/lib/apt/lists/*

# Go toolchain
RUN apt-get update && apt-get install -y --no-install-recommends golang-go \
    && rm -rf /var/lib/apt/lists/*

# Node.js (for frontend assets)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
    apt-get install -y --no-install-recommends nodejs \
    && rm -rf /var/lib/apt/lists/*

# Set working directory to repository root
WORKDIR "/photoprism"

# Copy source
COPY . .

# Build steps
RUN make dep && make build-go && make build-js

# Stage 2: Runtime
FROM ubuntu:noble-20260210.1 AS runtime

# Create a non-root user to run the server
RUN useradd -m photoprism

WORKDIR "/photoprism"

# Copy the built artifacts from the builder
COPY --from=builder /photoprism /photoprism

# Fix permissions and run as non-root
RUN chown -R photoprism:photoprism /photoprism
USER photoprism

# Expose the default PhotoPrism port
EXPOSE 2342

# Command to run the server in foreground
CMD ["./photoprism"]
WRITEWriteFile· step #2
0s
.dockerignore90 bytes written
dockerignore9 lines · 90 chars
node_modules
vendor
.git
.gitignore
.DS_Store
*.log
assets/**/*.build
assets/static/build
VERIFYVerifyBuild· step #3
2m 40s
VerifyBuildbuild_failed
Summary of tool output (actionable items preserved)

Status
- VerifyBuild status: build_failed
- Base image concern: ubuntu:noble-20260210.1 may be custom/private; verify exists or replace with standard Ubuntu base
- HEALTHCHECK: not defined
- Builder COPY: COPY . . copies full context; consider .dockerignore

Build failure details
- Failing step: RUN make dep && make build-go && make build-js (builder 7/7)
- Exit: make: *** [Makefile:361: build-develop] Error 128

Key error messages observed
- fatal: not a git repository (or any of the parent directories): .git
- scripts/download-facenet.sh: line 29: wget: command not found
- sha1sum: /tmp/photoprism/facenet.zip: No such file or directory
- scripts/download-facenet.sh: line 44: unzip: command not found
- Latest Facenet installed.
- scripts/download-nasnet.sh: line 30: wget: command not found
- scripts/download-nsfw.sh: line 29: wget: command not found
- scripts/download-scrfd.sh: line 29: wget: command not found during SCRFD download
- rm -f photoprism
- scripts/build.sh develop photoprism
- fatal: not a git repository (or any of the parent directories): .git
- make: *** [Makefile:361: build-develop] Error 128

Missing packages/files cited
- wget: command not found (needed to download models like facenet, nasnet, nsfw, SCRFD)
- unzip: command not found (needed to unzip downloaded model archives)
- .git context missing: fatal: not a git repository (or any of the parent directories): .git
- Downloaded/expected files not found due to failed downloads/unzips:
  - /tmp/photoprism/facenet.zip: No such file or directory
  - assets/models/facenet/version.txt: No such file or directory
  - assets/models/nasnet/version.txt: No such file or directory
  - assets/models/nsfw/version.txt: No such file or directory
- Note: SCRFD download reported success (“SCRFD detector installed in assets/models/scrfd.”) but earlier steps fail due to git and missing tooling

Version and environment snapshot
- Base image: ubuntu noble-20260210.1
- Node.js: NodeSource setup_20.x, nodejs 20.20.1-1nodesource1
- Go: golang-1.22-go installed (Go 1.22)
- Python: Python 3.12 (python3.12, libpython3.12-stdlib)
- Notable: several git-related checks fail due to missing .git directory in build context

Notes and potential fixes
- Install wget and unzip in the builder stage before model downloads
- Ensure a .git directory exists in the build context, or modify scripts to avoid relying on git metadata
- After adding wget/unzip, verify downloads to expected paths and that version.txt files are created:
  - facenet.zip, nasnet.zip, nsfw.zip
- If relying on a git repo, confirm proper git checkout or adapt scripts to work with a non-git tarball

End of summary.
WRITEWriteFile· step #4
1s
Dockerfile1438 bytes written
text61 lines · 1438 chars
# Stage 1: Builder
FROM ubuntu:noble-20260210.1 AS builder

ENV DEBIAN_FRONTEND=noninteractive

# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    curl \
    git \
    wget \
    unzip \
    build-essential \
    pkg-config \
    libjpeg-dev libpng-dev libwebp-dev \
    libx11-dev libgl1-mesa-dev \
    && rm -rf /var/lib/apt/lists/*

# Go toolchain
RUN apt-get update && apt-get install -y --no-install-recommends golang-go \
    && rm -rf /var/lib/apt/lists/*

# Node.js (for frontend assets)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
    apt-get install -y --no-install-recommends nodejs \
    && rm -rf /var/lib/apt/lists/*

# Set working directory to repository root
WORKDIR "/photoprism"

# Environment to avoid requiring a git repository for versioning
ENV BUILD_VERSION=local
ENV BUILD_TAG=local

# Copy source
COPY . .

# Build steps
RUN make dep && make build-go && make build-js

# Stage 2: Runtime
FROM ubuntu:noble-20260210.1 AS runtime

# Create a non-root user to run the server
RUN useradd -m photoprism

WORKDIR "/photoprism"

# Copy the built artifacts from the builder
COPY --from=builder /photoprism /photoprism

# Fix permissions and run as non-root
RUN chown -R photoprism:photoprism /photoprism
USER photoprism

# Expose the default PhotoPrism port
EXPOSE 2342

# Command to run the server in foreground
CMD ["./photoprism"]
VERIFYVerifyBuild· step #5
2m 23s
VerifyBuildbuild_failed
- Build status: VerifyBuild status: build_failed

- Concerns:
  - Runtime image may be missing necessary shared libraries required by the built photoprism binaries; container may fail to run unless binaries are statically linked or runtime dependencies are installed in final stage.
  - FROM image ubuntu:noble-20260210.1 may not be publicly available; ensure this tag exists or replace with a standard tag (e.g., ubuntu:22.04).
  - COPY . . copies the entire repository; without a .dockerignore, image can bloat. Add a .dockerignore to exclude docs, tests, git metadata, and large assets.

- Build error (concise):
  - Fatal error: fatal: not a git repository (or any of the parent directories): .git
  - make: *** [Makefile:361: build-develop] Error 128
  - Docker build exit: ERROR: failed to build: failed to solve: process "/bin/sh -c make dep && make build-go && make build-js" did not complete successfully: exit code: 2

- Failing command/step:
  - [builder 7/7] RUN make dep && make build-go && make build-js

- Missing packages or files:
  - Not a missing package/file; the log indicates Photoprism source dir is not a git repo (.git missing), causing the git metadata requirement to fail.

- Version/mismatch information (from build log):
  - Base image: ubuntu:noble-20260210.1
  - Node.js: NodeSource setup_20.x (nodejs 20.20.1)
  - Go: golang-1.22 (Go 1.22.x)
  - Python: Python 3.12 (3.12.3)
  - Issue is due to repository not being a git repository (.git missing), not a version mismatch.

- Additional context / recommendations:
  - The final Makefile target Build step "build-develop" relies on git metadata; ensure Photoprism source is checked out as a git repo (with .git) or adjust scripts to operate without a git checkout. Also verify the base image tag exists in the registry or switch to a standard tag. Consider adding a .dockerignore to speed up builds and reduce image size.
WRITEWriteFile· step #6
0s
.dockerignore85 bytes written
dockerignore8 lines · 85 chars
node_modules
vendor
.gitignore
.DS_Store
*.log
assets/**/*.build
assets/static/build
VERIFYVerifyBuild· step #7
2m 59s
VerifyBuildbuild_failed
Build error
Summary of Docker build error

- Failing command/step
  - The final RUN step in the builder: RUN make dep && make build-go && make build-js
  - Exit code: 2

- Exact error messages (preserved)
  - 104.4
    Package vips was not found in the pkg-config search path.
    Perhaps you should add the directory containing `vips.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'vips', required by 'virtual:world', not found
  - 108.7
    # github.com/wamuir/graft/tensorflow
    /root/go/pkg/mod/github.com/wamuir/graft@v0.10.0/tensorflow/signature.go:21:11: fatal error: tensorflow/c/c_api.h: No such file or directory
    # include "tensorflow/c/c_api.h"
    compilation terminated.
  - 136.0
    make: *** [Makefile:361: build-develop] Error 1

- Missing packages or files mentioned
  - libvips (vips) not found in pkg-config search path
  - TensorFlow C API header not found: tensorflow/c/c_api.h

- Version/mismatch information
  - Observed: Build attempts under ARM64 (Linux-ARM64) with Go 1.25.0 (go: downloading go1.25.0 (linux/arm64))
  - The log shows building PhotoPrism 260317-08fb7d8-Linux-ARM64 (develop) and subsequent dependency steps, but there is no explicit version mismatch error; the failures are due to missing system libraries (vips) and TensorFlow C headers.
WRITEWriteFile· step #8
0s
Dockerfile809 bytes written
text39 lines · 809 chars
# Stage 1: Builder
FROM photoprism/develop:jammy AS builder

ENV DEBIAN_FRONTEND=noninteractive

# Workdir set to repository root
WORKDIR "/photoprism"

# Environment to avoid requiring a git repository for versioning
ENV BUILD_VERSION=local
ENV BUILD_DATE=000000

# Copy source
COPY . .

# Build steps
RUN make dep && make build-go && make build-js

# Stage 2: Runtime
FROM photoprism/develop:jammy AS runtime

# Create a non-root user to run the server
RUN useradd -m photoprism

WORKDIR "/photoprism"

# Copy the built artifacts from the builder
COPY --from=builder /photoprism /photoprism

# Fix permissions and run as non-root
RUN chown -R photoprism:photoprism /photoprism
USER photoprism

# Expose the default PhotoPrism port
EXPOSE 2342

# Command to run the server in foreground
CMD ["./photoprism"]
VERIFYVerifyBuild· step #9
1m 49s
VerifyBuildbuild_failed
Build error
Summary:

- Exact error message and exit code:
  - "useradd: user 'photoprism' already exists"
  - Exit code: 9

- Failing command/step:
  - RUN useradd -m photoprism
  - Stage: [runtime 2/5], Dockerfile line 23

- Missing packages or files mentioned:
  - None reported as missing. The failure is due to the photoprism user already existing.

- Version mismatch info:
  - Base image: photoprism/develop:jammy (resolved digest sha256:499059de40a329f2866a1b04f016642229d5cedd9889c5b167c05b2e4954ee06)
  - No explicit version mismatch noted beyond that.
WRITEWriteFile· step #10
1s
Dockerfile1650 bytes written
text63 lines · 1650 chars
# Stage 1: Builder
FROM ubuntu:noble-20260210.1 AS builder

ENV DEBIAN_FRONTEND=noninteractive

# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    curl \
    git \
    wget \
    unzip \
    build-essential \
    pkg-config \
    libjpeg-dev libpng-dev libwebp-dev \
    libx11-dev libgl1-mesa-dev \
    libtiff-dev \
    libvips-dev \
    && rm -rf /var/lib/apt/lists/*

# Go toolchain
RUN apt-get update && apt-get install -y --no-install-recommends golang-go \
    && rm -rf /var/lib/apt/lists/*

# Node.js (for frontend assets)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
    apt-get install -y --no-install-recommends nodejs \
    && rm -rf /var/lib/apt/lists/*

# Clone the repository to ensure a valid .git directory is present
RUN git clone --depth 1 https://github.com/photoprism/photoprism.git /photoprism

# Set working directory to repository root
WORKDIR "/photoprism"

# Environment to indicate a local build if git metadata is unavailable
ENV BUILD_VERSION=local
ENV BUILD_TAG=local

# Build steps (may download external resources during dep)
RUN make dep && make build-go && make build-js

# Stage 2: Runtime
FROM ubuntu:noble-20260210.1 AS runtime

# Create a non-root user to run the server
RUN useradd -m photoprism

WORKDIR "/photoprism"

# Copy the built artifacts from the builder
COPY --from=builder /photoprism /photoprism

# Fix permissions and run as non-root
RUN chown -R photoprism:photoprism /photoprism
USER photoprism

# Expose the default PhotoPrism port
EXPOSE 2342

# Command to run the server in foreground
CMD ["./photoprism"]
VERIFYVerifyBuild· step #11
3m 34s
VerifyBuildbuild_failed
Build error
Summary of the Docker build error

- Exact error message and exit code
  - fatal error: tensorflow/c/c_api.h: No such file or directory
  - compilation terminated.
  - Exit code: 2

- Failing command/step
  - Failing step: builder 7/7
  - Command: RUN make dep && make build-go && make build-js
  - The error occurs during make build-go (Go compilation of graft/tensorflow)

- Missing packages or files mentioned
  - Missing file: tensorflow/c/c_api.h (TensorFlow C API header)
  - This indicates the TensorFlow C headers are not installed or not visible in the compiler include path

- Version mismatch info
  - Go toolchain used: go1.25.0 for linux/arm64 (as part of building PhotoPrism 260317-08fb7d8-Linux-ARM64-DEVELOP)
  - The failure stems from a missing TensorFlow C header required by the graft/tensorflow component, suggesting a mismatch between the expected TensorFlow C API headers and what’s present in the image.
WRITEWriteFile· step #12
1s
Dockerfile1076 bytes written
text36 lines · 1076 chars
# Stage 1: Builder
FROM photoprism/develop:260309-questing AS builder

# Ensure npm scripts are not run during install in this dev container
ENV NPM_CONFIG_IGNORE_SCRIPTS=true

# Set working directory to repository root (as in the repo layout)
WORKDIR "/go/src/github.com/photoprism/photoprism"

# Copy source to image
COPY . .

# Install/build dependencies and build both back-end (Go) and front-end (JS)
RUN make dep && make build-go && make build-js

# Stage 2: Runtime
FROM photoprism/develop:260309-questing AS runtime

# Create a non-root user to run the server
RUN id -u photoprism >/dev/null 2>&1 || useradd -m photoprism

WORKDIR "/go/src/github.com/photoprism/photoprism"

# Copy the built artifacts from the builder
COPY --from=builder /go/src/github.com/photoprism/photoprism /go/src/github.com/photoprism/photoprism

# Ensure correct permissions for the non-root user
RUN chown -R photoprism:photoprism /go/src/github.com/photoprism/photoprism
USER photoprism

# Expose the default PhotoPrism port
EXPOSE 2342

# Run the server in foreground
CMD ["./photoprism"]
VERIFYVerifyBuild· step #13
3m 42s
VerifyBuildaccepted
Concerns: Consider adding a .dockerignore to reduce build context and speed up builds., Ensure the built binary path matches the CMD location in the final image (photoprism). If the binary path changes, update CMD accordingly.
Smoke [PASS]: test -x photoprism
Smoke [PASS]: file photoprism | head -n 1
Smoke [PASS]: ls -l photoprism