From 77ddcecf29c95e1b33ba11046fd002ed3d408382 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Sat, 15 May 2021 14:05:52 +0200 Subject: [PATCH] Dockerfiles: Upgrade Ubuntu base image & Go version Reduces the number of layers by combining commands and env variables. --- Dockerfile | 2 +- Makefile | 6 +- docker/demo/Dockerfile | 36 ++++---- docker/development/Dockerfile | 45 +++++----- docker/photoprism/Dockerfile | 104 +++++++++++------------ docker/photoprism/arm32/Dockerfile | 127 ++++++++++++++--------------- docker/photoprism/arm64/Dockerfile | 127 ++++++++++++++--------------- 7 files changed, 208 insertions(+), 239 deletions(-) diff --git a/Dockerfile b/Dockerfile index b3a4da1a2..66bd5eb69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM photoprism/development:20210422 +FROM photoprism/development:20210515 # Set up project directory WORKDIR "/go/src/github.com/photoprism/photoprism" diff --git a/Makefile b/Makefile index 820e04d6f..423d8363d 100644 --- a/Makefile +++ b/Makefile @@ -165,7 +165,7 @@ clean: rm -rf storage/cache rm -rf frontend/node_modules docker-development: - docker pull ubuntu:20.10 + docker pull ubuntu:21.04 scripts/docker-build.sh development $(DOCKER_TAG) scripts/docker-push.sh development $(DOCKER_TAG) docker-photoprism: @@ -179,14 +179,14 @@ docker-photoprism-local: docker-photoprism-pull: docker pull photoprism/photoprism:latest docker-photoprism-arm64-preview: - docker pull ubuntu:20.10 + docker pull ubuntu:21.04 scripts/docker-build.sh photoprism-arm64 scripts/docker-push.sh photoprism-arm64 docker-photoprism-arm64: scripts/docker-build.sh photoprism-arm64 $(DOCKER_TAG) scripts/docker-push.sh photoprism-arm64 $(DOCKER_TAG) docker-photoprism-arm32-preview: - docker pull ubuntu:20.10 + docker pull ubuntu:21.04 scripts/docker-build.sh photoprism-arm32 scripts/docker-push.sh photoprism-arm32 docker-photoprism-arm32: diff --git a/docker/demo/Dockerfile b/docker/demo/Dockerfile index 4796b0c1f..205be27c9 100644 --- a/docker/demo/Dockerfile +++ b/docker/demo/Dockerfile @@ -1,7 +1,22 @@ FROM photoprism/photoprism:preview as build -# Hide TensorFlow warnings -ENV TF_CPP_MIN_LOG_LEVEL 2 +# Set environment variables +ENV TF_CPP_MIN_LOG_LEVEL=2 \ + PHOTOPRISM_STORAGE_PATH="/photoprism/storage" \ + PHOTOPRISM_DEBUG="false" \ + PHOTOPRISM_READONLY="false" \ + PHOTOPRISM_PUBLIC="true" \ + HOTOPRISM_DEMO="true" \ + PHOTOPRISM_EXPERIMENTAL="true" \ + PHOTOPRISM_UPLOAD_NSFW="false" \ + PHOTOPRISM_DETECT_NSFW="false" \ + PHOTOPRISM_THUMB_FILTER="lanczos" \ + PHOTOPRISM_THUMB_UNCACHED="true" \ + PHOTOPRISM_THUMB_SIZE=4096 \ + PHOTOPRISM_THUMB_SIZE_UNCACHED=4096 \ + PHOTOPRISM_JPEG_SIZE=4096 \ + PHOTOPRISM_JPEG_QUALITY=95 \ + PHOTOPRISM_SITE_CAPTION="Demo" # Copy assets COPY /docker/demo/index.tmpl /photoprism/assets/templates @@ -9,23 +24,6 @@ COPY /docker/demo/index.tmpl /photoprism/assets/templates # Download example photos RUN wget -qO- https://dl.photoprism.org/qa/demo.tar.gz | tar xvz -C /photoprism/originals -# Configure PhotoPrism -ENV PHOTOPRISM_STORAGE_PATH /photoprism/storage -ENV PHOTOPRISM_DEBUG false -ENV PHOTOPRISM_READONLY false -ENV PHOTOPRISM_PUBLIC true -ENV PHOTOPRISM_DEMO true -ENV PHOTOPRISM_EXPERIMENTAL true -ENV PHOTOPRISM_UPLOAD_NSFW false -ENV PHOTOPRISM_DETECT_NSFW false -ENV PHOTOPRISM_THUMB_FILTER lanczos -ENV PHOTOPRISM_THUMB_UNCACHED true -ENV PHOTOPRISM_THUMB_SIZE 4096 -ENV PHOTOPRISM_THUMB_SIZE_UNCACHED 4096 -ENV PHOTOPRISM_JPEG_SIZE 4096 -ENV PHOTOPRISM_JPEG_QUALITY 95 -ENV PHOTOPRISM_SITE_CAPTION "Demo" - # Import example photos RUN photoprism restore -a RUN photoprism index diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile index a3ccbef9e..e22772f15 100644 --- a/docker/development/Dockerfile +++ b/docker/development/Dockerfile @@ -1,10 +1,20 @@ -FROM ubuntu:20.10 +FROM ubuntu:21.04 LABEL maintainer="Michael Mayer " ARG BUILD_TAG -ENV DEBIAN_FRONTEND noninteractive +# Set environment variables +ENV DEBIAN_FRONTEND="noninteractive" \ + LD_LIBRARY_PATH="/root/.local/lib:/usr/local/lib:/usr/lib:/lib" \ + TF_CPP_MIN_LOG_LEVEL="0" \ + NODE_ENV="production" \ + GOPATH="/go" \ + GOBIN="/go/bin" \ + PATH="/go/bin:/usr/local/go/bin:~/.local/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ + TMPDIR="/tmp" \ + GO111MODULE="on" \ + CGO_CFLAGS="-g -O2 -Wno-return-local-addr" # Configure apt RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \ @@ -70,12 +80,10 @@ RUN apt-get update && apt-get upgrade && \ # We also have custom builds available: # https://dl.photoprism.org/tensorflow/linux/ # -ENV LD_LIBRARY_PATH /root/.local/lib:/usr/local/lib:/usr/lib:/lib -ENV TF_CPP_MIN_LOG_LEVEL 0 RUN curl -L \ "https://dl.photoprism.org/tensorflow/linux/libtensorflow-linux-cpu-1.15.2.tar.gz" | \ - tar -C "/usr" -xz -RUN ldconfig + tar -C "/usr" -xz && \ + ldconfig # Install NodeJS RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - @@ -85,36 +93,23 @@ RUN add-apt-repository -y ppa:saiarcot895/chromium-beta && \ apt-get install chromium-browser chromium-codecs-ffmpeg-extra nodejs && \ apt-get autoremove && \ apt-get clean && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ + umask 0000 -# Set default https://en.wikipedia.org/wiki/Umask -RUN umask 0000 - -# Install and configure NodeJS Package Manager (npm) -ENV NODE_ENV production +# Install NodeJS & NPM RUN npm install --unsafe-perm=true --allow-root -g npm testcafe chromedriver && \ npm config set cache ~/.cache/npm # Install Go -ENV GOLANG_VERSION 1.16.3 +ENV GOLANG_VERSION 1.16.4 RUN set -eux; \ - \ url="https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz"; \ wget -O go.tgz "$url"; \ - echo "951a3c7c6ce4e56ad883f97d9db74d3d6d80d5fec77455c6ada6c1f7ac4776d2 *go.tgz" | sha256sum -c -; \ + echo "7154e88f5a8047aad4b80ebace58a059e36e7e2e4eb3b383127a28c711b4ff59 *go.tgz" | sha256sum -c -; \ tar -C /usr/local -xzf go.tgz; \ rm go.tgz; \ - export PATH="/usr/local/go/bin:$PATH"; \ go version - -# Configure Go environment -ENV GOPATH /go -ENV GOBIN $GOPATH/bin -ENV PATH $GOBIN:/usr/local/go/bin:~/.local/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV TMPDIR /tmp -ENV GO111MODULE on -ENV CGO_CFLAGS "-g -O2 -Wno-return-local-addr" -RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +RUN mkdir -p "/go/src" "/go/bin" && chmod -R 777 "/go" # Download TensorFlow model and test files RUN rm -rf /tmp/* && mkdir -p /tmp/photoprism && \ diff --git a/docker/photoprism/Dockerfile b/docker/photoprism/Dockerfile index fc2bf63a1..2bd4dabc8 100644 --- a/docker/photoprism/Dockerfile +++ b/docker/photoprism/Dockerfile @@ -1,4 +1,4 @@ -FROM photoprism/development:20210422 as build +FROM photoprism/development:20210515 as build # Set up project directory WORKDIR "/go/src/github.com/photoprism/photoprism" @@ -8,10 +8,56 @@ COPY . . RUN make dep build-js install # Same base image as photoprism/development -FROM ubuntu:20.10 +FROM ubuntu:21.04 # Set environment variables -ENV DEBIAN_FRONTEND noninteractive +# see https://docs.photoprism.org/getting-started/config-options/ +ENV DEBIAN_FRONTEND="noninteractive" \ + TF_CPP_MIN_LOG_LEVEL="2" \ + PATH="/photoprism/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ + TMPDIR="/tmp" \ + PHOTOPRISM_ASSETS_PATH="/photoprism/assets" \ + PHOTOPRISM_STORAGE_PATH="/photoprism/storage" \ + PHOTOPRISM_BACKUP_PATH="/var/lib/photoprism" \ + PHOTOPRISM_ORIGINALS_PATH="/photoprism/originals" \ + PHOTOPRISM_IMPORT_PATH="/photoprism/import" \ + PHOTOPRISM_LOG_FILENAME="/photoprism/photoprism.log" \ + PHOTOPRISM_PID_FILENAME="/photoprism/photoprism.pid" \ + PHOTOPRISM_DEBUG="false" \ + PHOTOPRISM_PUBLIC="false" \ + PHOTOPRISM_READONLY="false" \ + PHOTOPRISM_UPLOAD_NSFW="true" \ + PHOTOPRISM_DETECT_NSFW="false" \ + PHOTOPRISM_EXPERIMENTAL="false" \ + PHOTOPRISM_SITE_URL="http://localhost:2342/" \ + PHOTOPRISM_SITE_TITLE="PhotoPrism" \ + PHOTOPRISM_SITE_CAPTION="Browse Your Life" \ + PHOTOPRISM_SITE_DESCRIPTION="" \ + PHOTOPRISM_SITE_AUTHOR="" \ + PHOTOPRISM_HTTP_HOST="0.0.0.0" \ + PHOTOPRISM_HTTP_PORT=2342 \ + PHOTOPRISM_DATABASE_DRIVER="sqlite" \ + PHOTOPRISM_DATABASE_SERVER="" \ + PHOTOPRISM_DATABASE_NAME="photoprism" \ + PHOTOPRISM_DATABASE_USER="photoprism" \ + PHOTOPRISM_DATABASE_PASSWORD="" \ + PHOTOPRISM_DISABLE_WEBDAV="false" \ + PHOTOPRISM_DISABLE_SETTINGS="false" \ + PHOTOPRISM_DISABLE_BACKUPS="false" \ + PHOTOPRISM_DISABLE_EXIFTOOL="false" \ + PHOTOPRISM_DISABLE_PLACES="false" \ + PHOTOPRISM_DISABLE_TENSORFLOW="false" \ + PHOTOPRISM_DARKTABLE_PRESETS="false" \ + PHOTOPRISM_THUMB_FILTER="lanczos" \ + PHOTOPRISM_THUMB_UNCACHED="false" \ + PHOTOPRISM_THUMB_SIZE=2048 \ + PHOTOPRISM_THUMB_SIZE_UNCACHED=7680 \ + PHOTOPRISM_JPEG_SIZE=7680 \ + PHOTOPRISM_JPEG_QUALITY=92 \ + PHOTOPRISM_WORKERS=0 \ + PHOTOPRISM_WAKEUP_INTERVAL=900 \ + PHOTOPRISM_AUTO_INDEX=300 \ + PHOTOPRISM_AUTO_IMPORT=300 # Configure apt-get RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \ @@ -56,58 +102,6 @@ RUN ldconfig RUN umask 0000 && useradd photoprism -m -d /photoprism WORKDIR /photoprism -ENV TF_CPP_MIN_LOG_LEVEL 2 - -ENV PATH /photoprism/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV TMPDIR /tmp - -# Storage path names -ENV PHOTOPRISM_ASSETS_PATH="/photoprism/assets" \ - PHOTOPRISM_STORAGE_PATH="/photoprism/storage" \ - PHOTOPRISM_BACKUP_PATH="/var/lib/photoprism" \ - PHOTOPRISM_ORIGINALS_PATH="/photoprism/originals" \ - PHOTOPRISM_IMPORT_PATH="/photoprism/import" \ - PHOTOPRISM_LOG_FILENAME="/photoprism/photoprism.log" \ - PHOTOPRISM_PID_FILENAME="/photoprism/photoprism.pid" - -# Defaults for common config values -# See https://docs.photoprism.org/getting-started/config-options/ -ENV PHOTOPRISM_DEBUG="false" \ - PHOTOPRISM_PUBLIC="false" \ - PHOTOPRISM_READONLY="false" \ - PHOTOPRISM_UPLOAD_NSFW="true" \ - PHOTOPRISM_DETECT_NSFW="false" \ - PHOTOPRISM_EXPERIMENTAL="false" \ - PHOTOPRISM_SITE_URL="http://localhost:2342/" \ - PHOTOPRISM_SITE_TITLE="PhotoPrism" \ - PHOTOPRISM_SITE_CAPTION="Browse Your Life" \ - PHOTOPRISM_SITE_DESCRIPTION="" \ - PHOTOPRISM_SITE_AUTHOR="" \ - PHOTOPRISM_HTTP_HOST="0.0.0.0" \ - PHOTOPRISM_HTTP_PORT=2342 \ - PHOTOPRISM_DATABASE_DRIVER="sqlite" \ - PHOTOPRISM_DATABASE_SERVER="" \ - PHOTOPRISM_DATABASE_NAME="photoprism" \ - PHOTOPRISM_DATABASE_USER="photoprism" \ - PHOTOPRISM_DATABASE_PASSWORD="" \ - PHOTOPRISM_DISABLE_WEBDAV="false" \ - PHOTOPRISM_DISABLE_SETTINGS="false" \ - PHOTOPRISM_DISABLE_BACKUPS="false" \ - PHOTOPRISM_DISABLE_EXIFTOOL="false" \ - PHOTOPRISM_DISABLE_PLACES="false" \ - PHOTOPRISM_DISABLE_TENSORFLOW="false" \ - PHOTOPRISM_DARKTABLE_PRESETS="false" \ - PHOTOPRISM_THUMB_FILTER="lanczos" \ - PHOTOPRISM_THUMB_UNCACHED="false" \ - PHOTOPRISM_THUMB_SIZE=2048 \ - PHOTOPRISM_THUMB_SIZE_UNCACHED=7680 \ - PHOTOPRISM_JPEG_SIZE=7680 \ - PHOTOPRISM_JPEG_QUALITY=92 \ - PHOTOPRISM_WORKERS=0 \ - PHOTOPRISM_WAKEUP_INTERVAL=900 \ - PHOTOPRISM_AUTO_INDEX=300 \ - PHOTOPRISM_AUTO_IMPORT=300 - # Copy files to /photoprism COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism COPY --from=build /root/.photoprism/assets /photoprism/assets diff --git a/docker/photoprism/arm32/Dockerfile b/docker/photoprism/arm32/Dockerfile index 1489841ae..78cfacf37 100644 --- a/docker/photoprism/arm32/Dockerfile +++ b/docker/photoprism/arm32/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.10 as build +FROM ubuntu:21.04 as build LABEL maintainer="Michael Mayer " @@ -50,8 +50,8 @@ RUN apt-get update && apt-get upgrade && \ # Big thank you to Qengineering for building this! # https://github.com/Qengineering/TensorFlow-Raspberry-Pi # -ENV LD_LIBRARY_PATH /root/.local/lib:/usr/local/lib:/usr/lib:/lib -ENV TF_CPP_MIN_LOG_LEVEL 0 +ENV LD_LIBRARY_PATH="/root/.local/lib:/usr/local/lib:/usr/lib:/lib" \ + TF_CPP_MIN_LOG_LEVEL="0" RUN curl -L \ "https://github.com/Qengineering/TensorFlow-Raspberry-Pi/blob/master/libtensorflow_1_15_2.tar.gz?raw=true" | \ tar -C "/usr" -xz @@ -72,24 +72,21 @@ RUN npm install --unsafe-perm=true --allow-root -g npm RUN npm config set cache ~/.cache/npm # Install Go -ENV GOLANG_VERSION 1.16.3 +ENV GOPATH="/go" \ + GOBIN="/go/bin" \ + PATH="/go/bin:/usr/local/go/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ + GO111MODULE="on" \ + CGO_CFLAGS="-g -O2 -Wno-return-local-addr" \ + GOLANG_VERSION=1.16.4 RUN set -eux; \ \ url="https://golang.org/dl/go${GOLANG_VERSION}.linux-armv6l.tar.gz"; \ curl -o go.tgz -L "$url"; \ - echo "0dae30385e3564a557dac7f12a63eedc73543e6da0f6017990e214ce8cc8797c *go.tgz" | sha256sum -c -; \ + echo "a53391a800ddec749ee90d38992babb27b95cfb864027350c737b9aa8e069494 *go.tgz" | sha256sum -c -; \ tar -C /usr/local -xzf go.tgz; \ rm go.tgz; \ - export PATH="/usr/local/go/bin:$PATH"; \ go version - -# Configure Go environment -ENV GOPATH /go -ENV GOBIN $GOPATH/bin -ENV PATH $GOBIN:/usr/local/go/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV GO111MODULE on -ENV CGO_CFLAGS "-g -O2 -Wno-return-local-addr" -RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +RUN mkdir -p "/go/src" "/go/bin" && chmod -R 777 "/go" # Download TensorFlow model and test files RUN rm -rf /tmp/* && mkdir -p /tmp/photoprism @@ -108,10 +105,56 @@ RUN make dep build-js install RUN env GO111MODULE=off /usr/local/go/bin/go get -u github.com/tianon/gosu # Same base image as photoprism/development -FROM ubuntu:20.10 +FROM ubuntu:21.04 # Set environment variables -ENV DEBIAN_FRONTEND noninteractive +# see https://docs.photoprism.org/getting-started/config-options/ +ENV DEBIAN_FRONTEND="noninteractive" \ + TF_CPP_MIN_LOG_LEVEL="2" \ + PATH="/photoprism/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ + TMPDIR="/tmp" \ + PHOTOPRISM_ASSETS_PATH="/photoprism/assets" \ + PHOTOPRISM_STORAGE_PATH="/photoprism/storage" \ + PHOTOPRISM_BACKUP_PATH="/var/lib/photoprism" \ + PHOTOPRISM_ORIGINALS_PATH="/photoprism/originals" \ + PHOTOPRISM_IMPORT_PATH="/photoprism/import" \ + PHOTOPRISM_LOG_FILENAME="/photoprism/photoprism.log" \ + PHOTOPRISM_PID_FILENAME="/photoprism/photoprism.pid" \ + PHOTOPRISM_DEBUG="false" \ + PHOTOPRISM_PUBLIC="false" \ + PHOTOPRISM_READONLY="false" \ + PHOTOPRISM_UPLOAD_NSFW="true" \ + PHOTOPRISM_DETECT_NSFW="false" \ + PHOTOPRISM_EXPERIMENTAL="false" \ + PHOTOPRISM_SITE_URL="http://localhost:2342/" \ + PHOTOPRISM_SITE_TITLE="PhotoPrism" \ + PHOTOPRISM_SITE_CAPTION="Browse Your Life" \ + PHOTOPRISM_SITE_DESCRIPTION="" \ + PHOTOPRISM_SITE_AUTHOR="" \ + PHOTOPRISM_HTTP_HOST="0.0.0.0" \ + PHOTOPRISM_HTTP_PORT="2342" \ + PHOTOPRISM_DATABASE_DRIVER="sqlite" \ + PHOTOPRISM_DATABASE_SERVER="" \ + PHOTOPRISM_DATABASE_NAME="photoprism" \ + PHOTOPRISM_DATABASE_USER="photoprism" \ + PHOTOPRISM_DATABASE_PASSWORD="" \ + PHOTOPRISM_DISABLE_WEBDAV="false" \ + PHOTOPRISM_DISABLE_SETTINGS="false" \ + PHOTOPRISM_DISABLE_BACKUPS="false" \ + PHOTOPRISM_DISABLE_EXIFTOOL="false" \ + PHOTOPRISM_DISABLE_PLACES="false" \ + PHOTOPRISM_DISABLE_TENSORFLOW="false" \ + PHOTOPRISM_DARKTABLE_PRESETS="false" \ + PHOTOPRISM_THUMB_FILTER="lanczos" \ + PHOTOPRISM_THUMB_UNCACHED="false" \ + PHOTOPRISM_THUMB_SIZE="2048" \ + PHOTOPRISM_THUMB_SIZE_UNCACHED="7680" \ + PHOTOPRISM_JPEG_SIZE="7680" \ + PHOTOPRISM_JPEG_QUALITY="92" \ + PHOTOPRISM_WORKERS="0" \ + PHOTOPRISM_WAKEUP_INTERVAL="900" \ + PHOTOPRISM_AUTO_INDEX="300" \ + PHOTOPRISM_AUTO_IMPORT="300" # Configure apt RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry @@ -153,58 +196,6 @@ RUN ldconfig RUN umask 0000 && useradd photoprism -m -d /photoprism WORKDIR /photoprism -ENV TF_CPP_MIN_LOG_LEVEL 2 - -ENV PATH /photoprism/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV TMPDIR /tmp - -# Storage path names -ENV PHOTOPRISM_ASSETS_PATH /photoprism/assets -ENV PHOTOPRISM_STORAGE_PATH /photoprism/storage -ENV PHOTOPRISM_BACKUP_PATH /var/lib/photoprism -ENV PHOTOPRISM_ORIGINALS_PATH /photoprism/originals -ENV PHOTOPRISM_IMPORT_PATH /photoprism/import -ENV PHOTOPRISM_LOG_FILENAME /photoprism/photoprism.log -ENV PHOTOPRISM_PID_FILENAME /photoprism/photoprism.pid - -# Defaults for common config values -# See https://docs.photoprism.org/getting-started/config-options/ -ENV PHOTOPRISM_DEBUG "false" -ENV PHOTOPRISM_PUBLIC "false" -ENV PHOTOPRISM_READONLY "false" -ENV PHOTOPRISM_UPLOAD_NSFW "true" -ENV PHOTOPRISM_DETECT_NSFW "false" -ENV PHOTOPRISM_EXPERIMENTAL "false" -ENV PHOTOPRISM_SITE_URL "http://localhost:2342/" -ENV PHOTOPRISM_SITE_TITLE "PhotoPrism" -ENV PHOTOPRISM_SITE_CAPTION "Browse Your Life" -ENV PHOTOPRISM_SITE_DESCRIPTION "" -ENV PHOTOPRISM_SITE_AUTHOR "" -ENV PHOTOPRISM_HTTP_HOST "0.0.0.0" -ENV PHOTOPRISM_HTTP_PORT 2342 -ENV PHOTOPRISM_DATABASE_DRIVER "sqlite" -ENV PHOTOPRISM_DATABASE_SERVER "" -ENV PHOTOPRISM_DATABASE_NAME "photoprism" -ENV PHOTOPRISM_DATABASE_USER "photoprism" -ENV PHOTOPRISM_DATABASE_PASSWORD "" -ENV PHOTOPRISM_DISABLE_WEBDAV "false" -ENV PHOTOPRISM_DISABLE_SETTINGS "false" -ENV PHOTOPRISM_DISABLE_BACKUPS "false" -ENV PHOTOPRISM_DISABLE_EXIFTOOL "false" -ENV PHOTOPRISM_DISABLE_PLACES "false" -ENV PHOTOPRISM_DISABLE_TENSORFLOW "false" -ENV PHOTOPRISM_DARKTABLE_PRESETS "false" -ENV PHOTOPRISM_THUMB_FILTER "lanczos" -ENV PHOTOPRISM_THUMB_UNCACHED "false" -ENV PHOTOPRISM_THUMB_SIZE 2048 -ENV PHOTOPRISM_THUMB_SIZE_UNCACHED 7680 -ENV PHOTOPRISM_JPEG_SIZE 7680 -ENV PHOTOPRISM_JPEG_QUALITY 92 -ENV PHOTOPRISM_WORKERS 0 -ENV PHOTOPRISM_WAKEUP_INTERVAL 900 -ENV PHOTOPRISM_AUTO_INDEX 300 -ENV PHOTOPRISM_AUTO_IMPORT 300 - # Copy files to /photoprism COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism COPY --from=build /root/.photoprism/assets /photoprism/assets diff --git a/docker/photoprism/arm64/Dockerfile b/docker/photoprism/arm64/Dockerfile index 912f22ef7..6560a3001 100644 --- a/docker/photoprism/arm64/Dockerfile +++ b/docker/photoprism/arm64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.10 as build +FROM ubuntu:21.04 as build LABEL maintainer="Michael Mayer " @@ -50,8 +50,8 @@ RUN apt-get update && apt-get upgrade && \ # Big thank you to Guy Sheffer for building this! # https://github.com/guysoft # -ENV LD_LIBRARY_PATH /root/.local/lib:/usr/local/lib:/usr/lib:/lib -ENV TF_CPP_MIN_LOG_LEVEL 0 +ENV LD_LIBRARY_PATH="/root/.local/lib:/usr/local/lib:/usr/lib:/lib" \ + TF_CPP_MIN_LOG_LEVEL="0" RUN curl -L \ "https://dl.photoprism.org/tensorflow/arm64/libtensorflow-arm64-1.15.2.tar.gz" | \ tar -C "/usr" -xz @@ -72,24 +72,21 @@ RUN npm install --unsafe-perm=true --allow-root -g npm && \ npm config set cache ~/.cache/npm # Install Go -ENV GOLANG_VERSION 1.16.3 +ENV GOPATH="/go" \ + GOBIN="/go/bin" \ + PATH="/go/bin:/usr/local/go/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ + GO111MODULE="on" \ + CGO_CFLAGS="-g -O2 -Wno-return-local-addr" \ + GOLANG_VERSION=1.16.4 RUN set -eux; \ \ url="https://golang.org/dl/go${GOLANG_VERSION}.linux-arm64.tar.gz"; \ wget -O go.tgz "$url"; \ - echo "566b1d6f17d2bc4ad5f81486f0df44f3088c3ed47a3bec4099d8ed9939e90d5d *go.tgz" | sha256sum -c -; \ + echo "8b18eb05ddda2652d69ab1b1dd1f40dd731799f43c6a58b512ad01ae5b5bba21 *go.tgz" | sha256sum -c -; \ tar -C /usr/local -xzf go.tgz; \ rm go.tgz; \ - export PATH="/usr/local/go/bin:$PATH"; \ go version - -# Configure Go environment -ENV GOPATH /go -ENV GOBIN $GOPATH/bin -ENV PATH $GOBIN:/usr/local/go/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV GO111MODULE on -ENV CGO_CFLAGS "-g -O2 -Wno-return-local-addr" -RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +RUN mkdir -p "/go/src" "/go/bin" && chmod -R 777 "/go" # Download TensorFlow model and test files RUN rm -rf /tmp/* && mkdir -p /tmp/photoprism @@ -107,10 +104,56 @@ RUN make dep build-js install RUN env GO111MODULE=off /usr/local/go/bin/go get -u github.com/tianon/gosu # Same base image as photoprism/development -FROM ubuntu:20.10 +FROM ubuntu:21.04 # Set environment variables -ENV DEBIAN_FRONTEND noninteractive +# see https://docs.photoprism.org/getting-started/config-options/ +ENV DEBIAN_FRONTEND="noninteractive" \ + TF_CPP_MIN_LOG_LEVEL="2" \ + PATH="/photoprism/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ + TMPDIR="/tmp" \ + PHOTOPRISM_ASSETS_PATH="/photoprism/assets" \ + PHOTOPRISM_STORAGE_PATH="/photoprism/storage" \ + PHOTOPRISM_BACKUP_PATH="/var/lib/photoprism" \ + PHOTOPRISM_ORIGINALS_PATH="/photoprism/originals" \ + PHOTOPRISM_IMPORT_PATH="/photoprism/import" \ + PHOTOPRISM_LOG_FILENAME="/photoprism/photoprism.log" \ + PHOTOPRISM_PID_FILENAME="/photoprism/photoprism.pid" \ + PHOTOPRISM_DEBUG="false" \ + PHOTOPRISM_PUBLIC="false" \ + PHOTOPRISM_READONLY="false" \ + PHOTOPRISM_UPLOAD_NSFW="true" \ + PHOTOPRISM_DETECT_NSFW="false" \ + PHOTOPRISM_EXPERIMENTAL="false" \ + PHOTOPRISM_SITE_URL="http://localhost:2342/" \ + PHOTOPRISM_SITE_TITLE="PhotoPrism" \ + PHOTOPRISM_SITE_CAPTION="Browse Your Life" \ + PHOTOPRISM_SITE_DESCRIPTION="" \ + PHOTOPRISM_SITE_AUTHOR="" \ + PHOTOPRISM_HTTP_HOST="0.0.0.0" \ + PHOTOPRISM_HTTP_PORT="2342" \ + PHOTOPRISM_DATABASE_DRIVER="sqlite" \ + PHOTOPRISM_DATABASE_SERVER="" \ + PHOTOPRISM_DATABASE_NAME="photoprism" \ + PHOTOPRISM_DATABASE_USER="photoprism" \ + PHOTOPRISM_DATABASE_PASSWORD="" \ + PHOTOPRISM_DISABLE_WEBDAV="false" \ + PHOTOPRISM_DISABLE_SETTINGS="false" \ + PHOTOPRISM_DISABLE_BACKUPS="false" \ + PHOTOPRISM_DISABLE_EXIFTOOL="false" \ + PHOTOPRISM_DISABLE_PLACES="false" \ + PHOTOPRISM_DISABLE_TENSORFLOW="false" \ + PHOTOPRISM_DARKTABLE_PRESETS="false" \ + PHOTOPRISM_THUMB_FILTER="lanczos" \ + PHOTOPRISM_THUMB_UNCACHED="false" \ + PHOTOPRISM_THUMB_SIZE="2048" \ + PHOTOPRISM_THUMB_SIZE_UNCACHED="7680" \ + PHOTOPRISM_JPEG_SIZE="7680" \ + PHOTOPRISM_JPEG_QUALITY="92" \ + PHOTOPRISM_WORKERS="0" \ + PHOTOPRISM_WAKEUP_INTERVAL="900" \ + PHOTOPRISM_AUTO_INDEX="300" \ + PHOTOPRISM_AUTO_IMPORT="300" # Configure apt RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry @@ -152,58 +195,6 @@ RUN ldconfig RUN umask 0000 && useradd photoprism -m -d /photoprism WORKDIR /photoprism -ENV TF_CPP_MIN_LOG_LEVEL 2 - -ENV PATH /photoprism/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV TMPDIR /tmp - -# Storage path names -ENV PHOTOPRISM_ASSETS_PATH /photoprism/assets -ENV PHOTOPRISM_STORAGE_PATH /photoprism/storage -ENV PHOTOPRISM_BACKUP_PATH /var/lib/photoprism -ENV PHOTOPRISM_ORIGINALS_PATH /photoprism/originals -ENV PHOTOPRISM_IMPORT_PATH /photoprism/import -ENV PHOTOPRISM_LOG_FILENAME /photoprism/photoprism.log -ENV PHOTOPRISM_PID_FILENAME /photoprism/photoprism.pid - -# Defaults for common config values -# See https://docs.photoprism.org/getting-started/config-options/ -ENV PHOTOPRISM_DEBUG "false" -ENV PHOTOPRISM_PUBLIC "false" -ENV PHOTOPRISM_READONLY "false" -ENV PHOTOPRISM_UPLOAD_NSFW "true" -ENV PHOTOPRISM_DETECT_NSFW "false" -ENV PHOTOPRISM_EXPERIMENTAL "false" -ENV PHOTOPRISM_SITE_URL "http://localhost:2342/" -ENV PHOTOPRISM_SITE_TITLE "PhotoPrism" -ENV PHOTOPRISM_SITE_CAPTION "Browse Your Life" -ENV PHOTOPRISM_SITE_DESCRIPTION "" -ENV PHOTOPRISM_SITE_AUTHOR "" -ENV PHOTOPRISM_HTTP_HOST "0.0.0.0" -ENV PHOTOPRISM_HTTP_PORT 2342 -ENV PHOTOPRISM_DATABASE_DRIVER "sqlite" -ENV PHOTOPRISM_DATABASE_SERVER "" -ENV PHOTOPRISM_DATABASE_NAME "photoprism" -ENV PHOTOPRISM_DATABASE_USER "photoprism" -ENV PHOTOPRISM_DATABASE_PASSWORD "" -ENV PHOTOPRISM_DISABLE_WEBDAV "false" -ENV PHOTOPRISM_DISABLE_SETTINGS "false" -ENV PHOTOPRISM_DISABLE_BACKUPS "false" -ENV PHOTOPRISM_DISABLE_EXIFTOOL "false" -ENV PHOTOPRISM_DISABLE_PLACES "false" -ENV PHOTOPRISM_DISABLE_TENSORFLOW "false" -ENV PHOTOPRISM_DARKTABLE_PRESETS "false" -ENV PHOTOPRISM_THUMB_FILTER "lanczos" -ENV PHOTOPRISM_THUMB_UNCACHED "false" -ENV PHOTOPRISM_THUMB_SIZE 2048 -ENV PHOTOPRISM_THUMB_SIZE_UNCACHED 7680 -ENV PHOTOPRISM_JPEG_SIZE 7680 -ENV PHOTOPRISM_JPEG_QUALITY 92 -ENV PHOTOPRISM_WORKERS 0 -ENV PHOTOPRISM_WAKEUP_INTERVAL 900 -ENV PHOTOPRISM_AUTO_INDEX 300 -ENV PHOTOPRISM_AUTO_IMPORT 300 - # Copy files to /photoprism COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism COPY --from=build /root/.photoprism/assets /photoprism/assets