RAW: Add install-darktable.sh script #445 #1632

This will install a newer version from opensuse.org if possible.
This commit is contained in:
Michael Mayer 2022-02-17 13:45:43 +01:00
parent 5add962ae0
commit c76d0e27ba
18 changed files with 200 additions and 124 deletions

View file

@ -27,16 +27,31 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing
# copy scripts # copy scripts
COPY --chown=root:root --chmod=755 /docker/scripts/*.sh /root/.local/bin/ COPY --chown=root:root --chmod=755 /docker/scripts/* /root/.local/bin/
# update image and install build dependencies # update image and install build dependencies
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
build-essential \ apt-utils \
gpg \
pkg-config \
software-properties-common \
ca-certificates \ ca-certificates \
build-essential \
gcc \
g++ \
sudo \
make \
nano \
git \
zip \
wget \ wget \
curl \ curl \
davfs2 \ rsync \
unzip \
sqlite3 \
chrpath \ chrpath \
gettext \
libc6-dev \
libssl-dev \ libssl-dev \
libxft-dev \ libxft-dev \
libfreetype6 \ libfreetype6 \
@ -51,23 +66,7 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
libnss3 \ libnss3 \
libxtst6 \ libxtst6 \
librsvg2-bin \ librsvg2-bin \
pkg-config \
software-properties-common \
rsync \
unzip \
zip \
g++ \
gcc \
libc6-dev \
gpg-agent \
apt-utils \
make \
nano \
git \
gettext \
sqlite3 \
tzdata \ tzdata \
gconf-service \
libheif-examples \ libheif-examples \
exiftool \ exiftool \
ffmpeg \ ffmpeg \
@ -91,9 +90,7 @@ RUN rm -rf /tmp/* && mkdir -p /tmp/photoprism && \
wget "https://dl.photoprism.app/qa/testdata.zip?${BUILD_TAG}" -O /tmp/photoprism/testdata.zip wget "https://dl.photoprism.app/qa/testdata.zip?${BUILD_TAG}" -O /tmp/photoprism/testdata.zip
# copy additional scripts to image # copy additional scripts to image
COPY --chown=root:root /docker/scripts/heif-convert.sh /usr/local/bin/heif-convert COPY --chown=root:root --chmod=755 /docker/develop/entrypoint.sh /entrypoint.sh
COPY --chown=root:root /docker/scripts/Makefile /root/Makefile
COPY --chown=root:root /docker/develop/entrypoint.sh /entrypoint.sh
# install Go tools # install Go tools
RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \ RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \
@ -109,7 +106,6 @@ RUN useradd -m -U -u 1000 -d /photoprism photoprism && chmod a+rwx /photoprism &
echo "photoprism ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ echo "photoprism ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \ chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod -Rf a+rw /photoprism /var/lib/photoprism /tmp/photoprism /go && \ chmod -Rf a+rw /photoprism /var/lib/photoprism /tmp/photoprism /go && \
chmod 755 /usr/local/bin/heif-convert /entrypoint.sh && \
find /go -type d -print0 | xargs -0 chmod 777 find /go -type d -print0 | xargs -0 chmod 777
# set up project directory # set up project directory

View file

@ -28,14 +28,16 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing
# copy scripts and backports sources # copy scripts
COPY --chown=root:root --chmod=755 /docker/scripts/*.sh /root/.local/bin/ COPY --chown=root:root --chmod=755 /docker/scripts/* /root/.local/bin/
# copy backport packages source list
COPY --chown=root:root --chmod=644 /docker/develop/bullseye/backports.list /etc/apt/sources.list.d/backports.list COPY --chown=root:root --chmod=644 /docker/develop/bullseye/backports.list /etc/apt/sources.list.d/backports.list
# update image and install build dependencies # update image and install build dependencies
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
apt-utils \ apt-utils \
gpg-agent \ gpg \
pkg-config \ pkg-config \
software-properties-common \ software-properties-common \
ca-certificates \ ca-certificates \
@ -84,13 +86,13 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
chrpath \ chrpath \
lsof \ lsof \
apache2-utils && \ apache2-utils && \
apt-get -qq install -t bullseye-backports darktable && \
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get update && apt-get -qq install nodejs && \ apt-get update && apt-get -qq install nodejs && \
npm install --unsafe-perm=true --allow-root -g npm && \ npm install --unsafe-perm=true --allow-root -g npm && \
npm config set cache ~/.cache/npm && \ npm config set cache ~/.cache/npm && \
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/* && \ /root/.local/bin/install-darktable.sh ${TARGETARCH} && \
/root/.local/bin/install-tensorflow.sh ${TARGETARCH} && \ /root/.local/bin/install-tensorflow.sh ${TARGETARCH} && \
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/* && \
mkdir -p "/go/src" "/go/bin" && \ mkdir -p "/go/src" "/go/bin" && \
chmod -R 777 "/go" chmod -R 777 "/go"
@ -102,9 +104,7 @@ RUN rm -rf /tmp/* && mkdir -p /tmp/photoprism && \
wget "https://dl.photoprism.app/qa/testdata.zip?${BUILD_TAG}" -O /tmp/photoprism/testdata.zip wget "https://dl.photoprism.app/qa/testdata.zip?${BUILD_TAG}" -O /tmp/photoprism/testdata.zip
# copy additional scripts to image # copy additional scripts to image
COPY --chown=root:root /docker/scripts/heif-convert.sh /usr/local/bin/heif-convert COPY --chown=root:root --chmod=755 /docker/develop/entrypoint.sh /entrypoint.sh
COPY --chown=root:root /docker/scripts/Makefile /root/Makefile
COPY --chown=root:root /docker/develop/entrypoint.sh /entrypoint.sh
# install Go tools # install Go tools
RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \ RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \
@ -122,7 +122,8 @@ RUN useradd -m -U -u 1000 -d /photoprism photoprism && chmod a+rwx /photoprism &
echo "photoprism ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ echo "photoprism ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \ chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod -Rf a+rw /photoprism /var/lib/photoprism /tmp/photoprism /go && \ chmod -Rf a+rw /photoprism /var/lib/photoprism /tmp/photoprism /go && \
chmod 755 /usr/local/bin/heif-convert /entrypoint.sh && \ mv /root/.local/bin/Makefile /root/Makefile && \
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
find /go -type d -print0 | xargs -0 chmod 777 find /go -type d -print0 | xargs -0 chmod 777
# copy mysql client config for develop # copy mysql client config for develop

View file

@ -28,14 +28,16 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing
# copy scripts and backports sources # copy scripts
COPY --chown=root:root --chmod=755 /docker/scripts/*.sh /root/.local/bin/ COPY --chown=root:root --chmod=755 /docker/scripts/* /root/.local/bin/
# copy backport packages source list
COPY --chown=root:root --chmod=644 /docker/develop/buster/backports.list /etc/apt/sources.list.d/backports.list COPY --chown=root:root --chmod=644 /docker/develop/buster/backports.list /etc/apt/sources.list.d/backports.list
# update image and install build dependencies # update image and install build dependencies
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
apt-utils \ apt-utils \
gpg-agent \ gpg \
pkg-config \ pkg-config \
software-properties-common \ software-properties-common \
ca-certificates \ ca-certificates \
@ -83,13 +85,13 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
chrpath \ chrpath \
lsof \ lsof \
apache2-utils && \ apache2-utils && \
apt-get -qq install -t buster-backports darktable && \
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get update && apt-get -qq install nodejs && \ apt-get update && apt-get -qq install nodejs && \
npm install --unsafe-perm=true --allow-root -g npm && \ npm install --unsafe-perm=true --allow-root -g npm && \
npm config set cache ~/.cache/npm && \ npm config set cache ~/.cache/npm && \
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/* && \ /root/.local/bin/install-darktable.sh ${TARGETARCH} && \
/root/.local/bin/install-tensorflow.sh ${TARGETARCH} && \ /root/.local/bin/install-tensorflow.sh ${TARGETARCH} && \
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/* && \
mkdir -p "/go/src" "/go/bin" && \ mkdir -p "/go/src" "/go/bin" && \
chmod -R 777 "/go" chmod -R 777 "/go"
@ -101,9 +103,7 @@ RUN rm -rf /tmp/* && mkdir -p /tmp/photoprism && \
wget "https://dl.photoprism.app/qa/testdata.zip?${BUILD_TAG}" -O /tmp/photoprism/testdata.zip wget "https://dl.photoprism.app/qa/testdata.zip?${BUILD_TAG}" -O /tmp/photoprism/testdata.zip
# copy additional scripts to image # copy additional scripts to image
COPY --chown=root:root /docker/scripts/heif-convert.sh /usr/local/bin/heif-convert COPY --chown=root:root --chmod=755 /docker/develop/entrypoint.sh /entrypoint.sh
COPY --chown=root:root /docker/scripts/Makefile /root/Makefile
COPY --chown=root:root /docker/develop/entrypoint.sh /entrypoint.sh
# install Go tools # install Go tools
RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \ RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \
@ -121,7 +121,8 @@ RUN useradd -m -U -u 1000 -d /photoprism photoprism && chmod a+rwx /photoprism &
echo "photoprism ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ echo "photoprism ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \ chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod -Rf a+rw /photoprism /var/lib/photoprism /tmp/photoprism /go && \ chmod -Rf a+rw /photoprism /var/lib/photoprism /tmp/photoprism /go && \
chmod 755 /usr/local/bin/heif-convert /entrypoint.sh && \ mv /root/.local/bin/Makefile /root/Makefile && \
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
find /go -type d -print0 | xargs -0 chmod 777 find /go -type d -print0 | xargs -0 chmod 777
# copy mysql client config for develop # copy mysql client config for develop

View file

@ -29,12 +29,14 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing
# copy scripts to /root/.local/bin # copy scripts to /root/.local/bin
COPY --chown=root:root --chmod=755 /docker/scripts/*.sh /root/.local/bin/ COPY --chown=root:root --chmod=755 /docker/scripts/* /root/.local/bin/
# update image and install build dependencies # update image and install build dependencies
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
apt-utils \ apt-utils \
gpg-agent \ gpg \
pkg-config \
software-properties-common \
ca-certificates \ ca-certificates \
build-essential \ build-essential \
g++ \ g++ \
@ -65,14 +67,11 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
libnss3 \ libnss3 \
libxtst6 \ libxtst6 \
librsvg2-bin \ librsvg2-bin \
pkg-config \
software-properties-common \
rsync \ rsync \
unzip \ unzip \
zip \ zip \
sqlite3 \ sqlite3 \
tzdata \ tzdata \
gconf-service \
libheif-examples \ libheif-examples \
exiftool \ exiftool \
rawtherapee \ rawtherapee \
@ -83,14 +82,15 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
apache2-utils \ apache2-utils \
fonts-roboto \ fonts-roboto \
sudo && \ sudo && \
[ "$TARGETARCH" = "arm" ] || apt-get -qq install darktable; \
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get update && apt-get -qq install nodejs && \ apt-get update && apt-get -qq install nodejs && \
npm install --unsafe-perm=true --allow-root -g npm && \ npm install --unsafe-perm=true --allow-root -g npm && \
npm config set cache ~/.cache/npm && \ npm config set cache ~/.cache/npm && \
/root/.local/bin/install-darktable.sh ${TARGETARCH} && \
/root/.local/bin/install-tensorflow.sh ${TARGETARCH} && \ /root/.local/bin/install-tensorflow.sh ${TARGETARCH} && \
/root/.local/bin/install-devtools.sh ${TARGETARCH} && \ /root/.local/bin/install-devtools.sh ${TARGETARCH} && \
/root/.local/bin/install-go.sh ${TARGETARCH} && \ /root/.local/bin/install-go.sh ${TARGETARCH} && \
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/* && \
mkdir -p "/go/src" "/go/bin" && \ mkdir -p "/go/src" "/go/bin" && \
chmod -R 777 "/go" chmod -R 777 "/go"
@ -102,9 +102,7 @@ RUN rm -rf /tmp/* && mkdir -p /tmp/photoprism && \
wget "https://dl.photoprism.app/qa/testdata.zip?${BUILD_TAG}" -O /tmp/photoprism/testdata.zip wget "https://dl.photoprism.app/qa/testdata.zip?${BUILD_TAG}" -O /tmp/photoprism/testdata.zip
# copy additional scripts to image # copy additional scripts to image
COPY --chown=root:root /docker/scripts/heif-convert.sh /usr/local/bin/heif-convert COPY --chown=root:root --chmod=755 /docker/develop/entrypoint.sh /entrypoint.sh
COPY --chown=root:root /docker/scripts/Makefile /root/Makefile
COPY --chown=root:root /docker/develop/entrypoint.sh /entrypoint.sh
# install Go tools # install Go tools
RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \ RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \
@ -123,7 +121,8 @@ RUN useradd -m -U -u 1000 -d /photoprism photoprism && chmod a+rwx /photoprism &
echo "photoprism ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ echo "photoprism ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \ chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod -Rf a+rw /photoprism /var/lib/photoprism /tmp/photoprism /go && \ chmod -Rf a+rw /photoprism /var/lib/photoprism /tmp/photoprism /go && \
chmod 755 /usr/local/bin/heif-convert /entrypoint.sh && \ mv /root/.local/bin/Makefile /root/Makefile && \
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
find /go -type d -print0 | xargs -0 chmod 777 find /go -type d -print0 | xargs -0 chmod 777
# copy mysql client config for develop # copy mysql client config for develop

View file

@ -34,10 +34,13 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing
# copy scripts
COPY --chown=root:root --chmod=755 /docker/scripts/* /root/.local/bin/
# install additional distribution packages # install additional distribution packages
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
ca-certificates \ ca-certificates \
gpgv \ gpg \
wget \ wget \
curl \ curl \
make \ make \
@ -117,10 +120,7 @@ WORKDIR /photoprism
# copy additional files to image # copy additional files to image
COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism
COPY --from=build /root/.photoprism/assets /photoprism/assets COPY --from=build /root/.photoprism/assets /photoprism/assets
COPY --chown=root:root /docker/scripts/heif-convert.sh /usr/local/bin/heif-convert COPY --chown=root:root --chmod=755 /docker/photoprism/entrypoint.sh /entrypoint.sh
COPY --chown=root:root /docker/scripts/cleanup.sh /usr/local/bin/cleanup
COPY --chown=root:root /docker/scripts/Makefile /root/Makefile
COPY --chown=root:root /docker/photoprism/entrypoint.sh /entrypoint.sh
# create directories # create directories
RUN mkdir -m 777 -p \ RUN mkdir -m 777 -p \
@ -130,11 +130,12 @@ RUN mkdir -m 777 -p \
/photoprism/import \ /photoprism/import \
/photoprism/storage/config \ /photoprism/storage/config \
/photoprism/storage/cache && \ /photoprism/storage/cache && \
mv /root/.local/bin/Makefile /root/Makefile && \
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \ chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod -Rf a+rwx /photoprism /var/lib/photoprism /tmp/photoprism && \ chmod -Rf a+rwx /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod 755 /usr/local/bin/heif-convert /entrypoint.sh && \
photoprism -v && \ photoprism -v && \
/usr/local/bin/cleanup /root/.local/bin/cleanup.sh
# expose http port # expose http port
EXPOSE 2342 EXPOSE 2342

View file

@ -34,13 +34,16 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing
# copy backports sources # copy scripts
COPY --chown=root:root --chmod=755 /docker/scripts/* /root/.local/bin/
# copy debian backports source
COPY --chown=root:root --chmod=644 /docker/develop/bullseye/backports.list /etc/apt/sources.list.d/backports.list COPY --chown=root:root --chmod=644 /docker/develop/bullseye/backports.list /etc/apt/sources.list.d/backports.list
# install additional distribution packages # install additional distribution packages
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
ca-certificates \ ca-certificates \
gpgv \ gpg \
wget \ wget \
curl \ curl \
make \ make \
@ -56,7 +59,7 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
ffmpeg \ ffmpeg \
ffmpegthumbnailer \ ffmpegthumbnailer \
libavcodec-extra && \ libavcodec-extra && \
[ "$TARGETARCH" = "arm" ] || apt-get -qq install -t bullseye-backports darktable; \ /root/.local/bin/install-darktable.sh ${TARGETARCH} && \
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/* apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/*
# set environment variables, see https://docs.photoprism.app/getting-started/config-options/ # set environment variables, see https://docs.photoprism.app/getting-started/config-options/
@ -121,10 +124,7 @@ WORKDIR /photoprism
# copy additional files to image # copy additional files to image
COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism
COPY --from=build /root/.photoprism/assets /photoprism/assets COPY --from=build /root/.photoprism/assets /photoprism/assets
COPY --chown=root:root /docker/scripts/heif-convert.sh /usr/local/bin/heif-convert COPY --chown=root:root --chmod=755 /docker/photoprism/entrypoint.sh /entrypoint.sh
COPY --chown=root:root /docker/scripts/cleanup.sh /usr/local/bin/cleanup
COPY --chown=root:root /docker/scripts/Makefile /root/Makefile
COPY --chown=root:root /docker/photoprism/entrypoint.sh /entrypoint.sh
# create directories # create directories
RUN mkdir -m 777 -p \ RUN mkdir -m 777 -p \
@ -134,11 +134,12 @@ RUN mkdir -m 777 -p \
/photoprism/import \ /photoprism/import \
/photoprism/storage/config \ /photoprism/storage/config \
/photoprism/storage/cache && \ /photoprism/storage/cache && \
mv /root/.local/bin/Makefile /root/Makefile && \
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \ chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod -Rf a+rwx /photoprism /var/lib/photoprism /tmp/photoprism && \ chmod -Rf a+rwx /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod 755 /usr/local/bin/heif-convert /entrypoint.sh && \
photoprism -v && \ photoprism -v && \
/usr/local/bin/cleanup /root/.local/bin/cleanup.sh
# expose http port # expose http port
EXPOSE 2342 EXPOSE 2342

View file

@ -34,13 +34,16 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing
# copy scripts
COPY --chown=root:root --chmod=755 /docker/scripts/* /root/.local/bin/
# copy backports sources # copy backports sources
COPY --chown=root:root --chmod=644 /docker/develop/buster/backports.list /etc/apt/sources.list.d/backports.list COPY --chown=root:root --chmod=644 /docker/develop/buster/backports.list /etc/apt/sources.list.d/backports.list
# install additional distribution packages # install additional distribution packages
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
ca-certificates \ ca-certificates \
gpgv \ gpg \
wget \ wget \
curl \ curl \
make \ make \
@ -57,7 +60,7 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
ffmpeg \ ffmpeg \
ffmpegthumbnailer \ ffmpegthumbnailer \
libavcodec-extra && \ libavcodec-extra && \
[ "$TARGETARCH" = "arm" ] || apt-get -qq install -t buster-backports darktable; \ /root/.local/bin/install-darktable.sh ${TARGETARCH} && \
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/* apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/*
# set environment variables, see https://docs.photoprism.app/getting-started/config-options/ # set environment variables, see https://docs.photoprism.app/getting-started/config-options/
@ -122,10 +125,7 @@ WORKDIR /photoprism
# copy additional files to image # copy additional files to image
COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism
COPY --from=build /root/.photoprism/assets /photoprism/assets COPY --from=build /root/.photoprism/assets /photoprism/assets
COPY --chown=root:root /docker/scripts/heif-convert.sh /usr/local/bin/heif-convert COPY --chown=root:root --chmod=755 /docker/photoprism/entrypoint.sh /entrypoint.sh
COPY --chown=root:root /docker/scripts/cleanup.sh /usr/local/bin/cleanup
COPY --chown=root:root /docker/scripts/Makefile /root/Makefile
COPY --chown=root:root /docker/photoprism/entrypoint.sh /entrypoint.sh
# create directories # create directories
RUN mkdir -m 777 -p \ RUN mkdir -m 777 -p \
@ -135,11 +135,12 @@ RUN mkdir -m 777 -p \
/photoprism/import \ /photoprism/import \
/photoprism/storage/config \ /photoprism/storage/config \
/photoprism/storage/cache && \ /photoprism/storage/cache && \
mv /root/.local/bin/Makefile /root/Makefile && \
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \ chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod -Rf a+rwx /photoprism /var/lib/photoprism /tmp/photoprism && \ chmod -Rf a+rwx /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod 755 /usr/local/bin/heif-convert /entrypoint.sh && \
photoprism -v && \ photoprism -v && \
/usr/local/bin/cleanup /root/.local/bin/cleanup.s
# expose http port # expose http port
EXPOSE 2342 EXPOSE 2342

View file

@ -34,10 +34,13 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing
# copy scripts
COPY --chown=root:root --chmod=755 /docker/scripts/* /root/.local/bin/
# install additional distribution packages # install additional distribution packages
RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
ca-certificates \ ca-certificates \
gpgv \ gpg \
wget \ wget \
curl \ curl \
make \ make \
@ -53,7 +56,7 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
ffmpeg \ ffmpeg \
ffmpegthumbnailer \ ffmpegthumbnailer \
libavcodec-extra && \ libavcodec-extra && \
[ "$TARGETARCH" = "arm" ] || apt-get -y install darktable; \ /root/.local/bin/install-darktable.sh ${TARGETARCH} && \
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/* apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/*
# set environment variables, see https://docs.photoprism.app/getting-started/config-options/ # set environment variables, see https://docs.photoprism.app/getting-started/config-options/
@ -118,10 +121,7 @@ WORKDIR /photoprism
# copy additional files to image # copy additional files to image
COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism
COPY --from=build /root/.photoprism/assets /photoprism/assets COPY --from=build /root/.photoprism/assets /photoprism/assets
COPY --chown=root:root /docker/scripts/heif-convert.sh /usr/local/bin/heif-convert COPY --chown=root:root --chmod=755 /docker/photoprism/entrypoint.sh /entrypoint.sh
COPY --chown=root:root /docker/scripts/cleanup.sh /usr/local/bin/cleanup
COPY --chown=root:root /docker/scripts/Makefile /root/Makefile
COPY --chown=root:root /docker/photoprism/entrypoint.sh /entrypoint.sh
# create directories # create directories
RUN mkdir -m 777 -p \ RUN mkdir -m 777 -p \
@ -131,11 +131,12 @@ RUN mkdir -m 777 -p \
/photoprism/import \ /photoprism/import \
/photoprism/storage/config \ /photoprism/storage/config \
/photoprism/storage/cache && \ /photoprism/storage/cache && \
mv /root/.local/bin/Makefile /root/Makefile && \
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \ chown -Rf photoprism:photoprism /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod -Rf a+rwx /photoprism /var/lib/photoprism /tmp/photoprism && \ chmod -Rf a+rwx /photoprism /var/lib/photoprism /tmp/photoprism && \
chmod 755 /usr/local/bin/heif-convert /entrypoint.sh && \
photoprism -v && \ photoprism -v && \
/usr/local/bin/cleanup /root/.local/bin/cleanup.sh
# expose http port # expose http port
EXPOSE 2342 EXPOSE 2342

View file

@ -1,10 +1,17 @@
#!/bin/bash #!/usr/bin/env bash
# abort if the user is not root
if [[ $(id -u) != "0" ]]; then
echo "Usage: run cleanup.sh as root" 1>&2
exit 1
fi
set -o errexit set -o errexit
if [[ ! -d /tmp ]]; then if [[ ! -d /tmp ]]; then
mkdir /tmp mkdir /tmp
fi fi
chmod 1777 /tmp chmod 1777 /tmp
apt-get -y autoremove apt-get -y autoremove

View file

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# check if user is root # abort if the user is not root
if [[ $(id -u) != "0" ]]; then if [[ $(id -u) != "0" ]]; then
echo "failed, please run as root" 1>&2 echo "Usage: run dist-upgrade.sh as root" 1>&2
exit 1 exit 1
fi fi

View file

@ -1,12 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [[ -z $1 ]] && [[ -z $2 ]]; then if [[ -z $1 ]] && [[ -z $2 ]]; then
echo "USAGE: heif-convert <filename> <output>" 1>&2 echo "Usage: heif-convert <filename> <output>" 1>&2
exit 1 exit 1
fi fi
# Usage: heif-convert [-q quality 0..100] <filename> <output>
# USAGE: heif-convert [-q quality 0..100] <filename> <output>
/usr/bin/heif-convert -q 92 "$1" "$2" /usr/bin/heif-convert -q 92 "$1" "$2"

View file

@ -0,0 +1,46 @@
#!/usr/bin/env bash
# abort if the user is not root
if [[ $(id -u) != "0" ]]; then
echo "Usage: run install-darktable.sh as root" 1>&2
exit 1
fi
set -e
. /etc/os-release
if [[ -z $1 ]]; then
echo "Usage: install-darktable.sh [amd64|arm64|arm]" 1>&2
exit 1
elif [[ $1 == "amd64" ]]; then
if [[ $VERSION_CODENAME == "bullseye" ]]; then
echo 'deb http://download.opensuse.org/repositories/graphics:/darktable/Debian_11/ /' | tee /etc/apt/sources.list.d/graphics:darktable.list
curl -fsSL https://download.opensuse.org/repositories/graphics:darktable/Debian_11/Release.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/graphics_darktable.gpg > /dev/null
apt-get update
apt-get -qq install darktable
elif [[ $VERSION_CODENAME == "buster" ]]; then
echo 'deb http://download.opensuse.org/repositories/graphics:/darktable/Debian_10/ /' | tee /etc/apt/sources.list.d/graphics:darktable.list
curl -fsSL https://download.opensuse.org/repositories/graphics:darktable/Debian_10/Release.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/graphics_darktable.gpg > /dev/null
apt-get update
apt-get -qq install darktable
else
echo "install-darktable: installing standard amd64 (Intel 64-bit) package"
apt-get -qq install darktable
fi
echo "install-darktable: done"
elif [[ $1 == "arm64" ]]; then
if [[ $VERSION_CODENAME == "bullseye" ]]; then
apt-get update
apt-get -qq install -t bullseye-backports darktable
elif [[ $VERSION_CODENAME == "buster" ]]; then
apt-get update
apt-get -qq install -t buster-backports darktable
else
echo "install-darktable: installing standard amd64 (ARM 64-bit) package"
apt-get -qq install darktable
fi
echo "install-darktable: done"
else
echo "install-darktable: unsupported architecture $1"
fi

View file

@ -1,14 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# abort if the user is not root
if [[ $(id -u) != "0" ]]; then if [[ $(id -u) != "0" ]]; then
echo "root privileges required" echo "Usage: run install-devtools.sh as root" 1>&2
exit 1 exit 1
fi fi
set -e set -e
if [[ -z $1 ]]; then if [[ -z $1 ]]; then
echo "architecture required: amd64, arm64, or arm" 1>&2 echo "Usage: install-devtools.sh [amd64|arm64|arm]" 1>&2
exit 1 exit 1
else else
set -eux; set -eux;

View file

@ -1,11 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# abort if the user is not root
if [[ $(id -u) != "0" ]]; then
echo "Usage: run install-go.sh as root" 1>&2
exit 1
fi
set -e set -e
GOLANG_VERSION=1.17.7 GOLANG_VERSION=1.17.7
if [[ -z $1 ]]; then if [[ -z $1 ]]; then
echo "architecture required: amd64, arm64, or arm" 1>&2 echo "Usage: install-go.sh [amd64|arm64|arm]" 1>&2
exit 1 exit 1
else else
set -eux; set -eux;
@ -19,7 +25,7 @@ else
URL="https://go.dev/dl/go${GOLANG_VERSION}.linux-armv6l.tar.gz" URL="https://go.dev/dl/go${GOLANG_VERSION}.linux-armv6l.tar.gz"
CHECKSUM="874774f078b182fa21ffcb3878467eb5cb7e78bbffa6343ea5f0fbe47983433b *go.tgz" CHECKSUM="874774f078b182fa21ffcb3878467eb5cb7e78bbffa6343ea5f0fbe47983433b *go.tgz"
else else
echo "unsupported architecture" 1>&2 echo "install-go: unsupported architecture" 1>&2
exit 1 exit 1
fi fi
wget -O go.tgz $URL wget -O go.tgz $URL

View file

@ -1,10 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# abort if the user is not root
if [[ $(id -u) != "0" ]]; then
echo "Usage: run install-tensorflow.sh as root" 1>&2
exit 1
fi
if [[ -z $1 ]] && [[ -z $2 ]]; then if [[ -z $1 ]] && [[ -z $2 ]]; then
echo "Please define architecture and variant (cpu/avx2/...)" 1>&2 echo "Usage: install-tensorflow.sh [amd64|arm64|arm] [cpu|avx|avx2]" 1>&2
exit 1 exit 1
else else
echo "Downloading tensorflow library..." echo "install-tensorflow: downloading library..."
if [[ $1 == "amd64" ]]; then if [[ $1 == "amd64" ]]; then
TARGETARCH="linux" TARGETARCH="linux"
TARGETVARIANT="-${2:-"cpu"}" TARGETVARIANT="-${2:-"cpu"}"
@ -14,12 +20,12 @@ else
elif [[ $1 == "arm" ]]; then elif [[ $1 == "arm" ]]; then
URL="https://dl.photoprism.app/tensorflow/$1/libtensorflow-$1-1.15.2.tar.gz" URL="https://dl.photoprism.app/tensorflow/$1/libtensorflow-$1-1.15.2.tar.gz"
else else
echo "cpu architecture not supported by now" 1>&2 echo "install-tensorflow: unsupported architecture" 1>&2
exit 1 exit 1
fi fi
echo "$URL" echo "$URL"
curl -fsSL "$URL" | \ curl -fsSL "$URL" | \
tar --overwrite -C "/usr" -xz && \ tar --overwrite -C "/usr" -xz && \
ldconfig ldconfig
echo "Done" echo "install-tensorflow: done"
fi fi

View file

@ -6,7 +6,7 @@ set -e
export DOCKER_BUILDKIT=1 export DOCKER_BUILDKIT=1
if [[ -z $1 ]] || [[ -z $2 ]]; then if [[ -z $1 ]] || [[ -z $2 ]]; then
echo "usage: scripts/docker/build.sh [image] [tag] [/subimage]" 1>&2 echo "Usage: scripts/docker/build.sh [name] [tag] [/subimage]" 1>&2
exit 1 exit 1
fi fi
@ -14,8 +14,11 @@ NUMERIC='^[0-9]+$'
GOPROXY=${GOPROXY:-'https://proxy.golang.org,direct'} GOPROXY=${GOPROXY:-'https://proxy.golang.org,direct'}
DOCKER_TAG=$(date -u +%Y%m%d) DOCKER_TAG=$(date -u +%Y%m%d)
echo "docker/build: building photoprism/$1 from docker/${1/-//}$3/Dockerfile...";
if [[ $1 ]] && [[ -z $2 || $2 == "preview" ]]; then if [[ $1 ]] && [[ -z $2 || $2 == "preview" ]]; then
echo "docker/build: building photoprism/$1:preview from docker/${1/-//}$3/Dockerfile..."; echo "build tags: preview"
docker build \ docker build \
--pull \ --pull \
--no-cache \ --no-cache \
@ -25,10 +28,10 @@ if [[ $1 ]] && [[ -z $2 || $2 == "preview" ]]; then
-t photoprism/$1:preview \ -t photoprism/$1:preview \
-f docker/${1/-//}$3/Dockerfile . -f docker/${1/-//}$3/Dockerfile .
elif [[ $2 =~ $NUMERIC ]]; then elif [[ $2 =~ $NUMERIC ]]; then
echo "docker/build: building photoprism/$1:$2,$1:latest from docker/${1/-//}$3/Dockerfile..."; echo "build tags: $2, latest"
if [[ $4 ]]; then if [[ $4 ]]; then
echo "extra params: $4" echo "build params: $4"
fi fi
docker build $4\ docker build $4\
@ -41,10 +44,10 @@ elif [[ $2 =~ $NUMERIC ]]; then
-t photoprism/$1:$2 \ -t photoprism/$1:$2 \
-f docker/${1/-//}$3/Dockerfile . -f docker/${1/-//}$3/Dockerfile .
elif [[ $2 == *"preview"* ]]; then elif [[ $2 == *"preview"* ]]; then
echo "docker/build: building photoprism/$1:$2 from docker/${1/-//}$3/Dockerfile..."; echo "build tags: $2"
if [[ $4 ]]; then if [[ $4 ]]; then
echo "extra params: $4" echo "build params: $4"
fi fi
docker build $4\ docker build $4\
@ -56,10 +59,10 @@ elif [[ $2 == *"preview"* ]]; then
-t photoprism/$1:$2 \ -t photoprism/$1:$2 \
-f docker/${1/-//}$3/Dockerfile . -f docker/${1/-//}$3/Dockerfile .
else else
echo "docker/build: building photoprism/$1:$2,$1:$DOCKER_TAG-$2 from docker/${1/-//}$3/Dockerfile..."; echo "build tags: $DOCKER_TAG-$2, $2"
if [[ $4 ]]; then if [[ $4 ]]; then
echo "extra params: $4" echo "build params: $4"
fi fi
docker build $4\ docker build $4\
@ -69,7 +72,7 @@ else
--build-arg GOPROXY \ --build-arg GOPROXY \
--build-arg GODEBUG \ --build-arg GODEBUG \
-t photoprism/$1:$2 \ -t photoprism/$1:$2 \
-t photoprism/$1:$DOCKER_TAG-$2 $5 \ -t photoprism/$1:$DOCKER_TAG-$2 \
-f docker/${1/-//}$3/Dockerfile . -f docker/${1/-//}$3/Dockerfile .
fi fi

View file

@ -4,7 +4,7 @@
export DOCKER_BUILDKIT=1 export DOCKER_BUILDKIT=1
if [[ -z $1 ]] || [[ -z $2 ]]; then if [[ -z $1 ]] || [[ -z $2 ]]; then
echo "usage: scripts/docker/buildx-multi.sh [image] [linux/amd64|linux/arm64|linux/arm] [tag] [/subimage]" 1>&2 echo "Usage: scripts/docker/buildx-multi.sh [name] [linux/amd64|linux/arm64|linux/arm] [tag] [/subimage]" 1>&2
exit 1 exit 1
fi fi
@ -22,8 +22,11 @@ sleep 3
# create new multibuilder. # create new multibuilder.
docker buildx create --name multibuilder --use || { echo 'failed'; exit 1; } docker buildx create --name multibuilder --use || { echo 'failed'; exit 1; }
echo "docker/buildx-multi: building photoprism/$1 from docker/${1/-//}$4/Dockerfile..."
if [[ $1 ]] && [[ $2 ]] && [[ -z $3 || $3 == "preview" ]]; then if [[ $1 ]] && [[ $2 ]] && [[ -z $3 || $3 == "preview" ]]; then
echo "docker/buildx-multi: building photoprism/$1:preview from docker/${1/-//}$4/Dockerfile..." echo "build tags: preview"
docker buildx build \ docker buildx build \
--platform $2 \ --platform $2 \
--pull \ --pull \
@ -35,10 +38,10 @@ if [[ $1 ]] && [[ $2 ]] && [[ -z $3 || $3 == "preview" ]]; then
-t photoprism/$1:preview \ -t photoprism/$1:preview \
--push . --push .
elif [[ $3 =~ $NUMERIC ]]; then elif [[ $3 =~ $NUMERIC ]]; then
echo "docker/buildx-multi: building photoprism/$1:$3,$1:latest from docker/${1/-//}$4/Dockerfile..." echo "build tags: $3, latest"
if [[ $5 ]]; then if [[ $5 ]]; then
echo "extra params: $5" echo "build params: $5"
fi fi
docker buildx build \ docker buildx build \
@ -53,10 +56,10 @@ elif [[ $3 =~ $NUMERIC ]]; then
-t photoprism/$1:$3 $5 \ -t photoprism/$1:$3 $5 \
--push . --push .
elif [[ $4 ]] && [[ $3 == *"preview"* ]]; then elif [[ $4 ]] && [[ $3 == *"preview"* ]]; then
echo "docker/buildx-multi: building photoprism/$1:$3 from docker/${1/-//}$4/Dockerfile..." echo "build tags: $3"
if [[ $5 ]]; then if [[ $5 ]]; then
echo "extra params: $5" echo "build params: $5"
fi fi
docker buildx build \ docker buildx build \
@ -70,10 +73,10 @@ elif [[ $4 ]] && [[ $3 == *"preview"* ]]; then
-t photoprism/$1:$3 $5 \ -t photoprism/$1:$3 $5 \
--push . --push .
elif [[ $4 ]]; then elif [[ $4 ]]; then
echo "docker/buildx-multi: building photoprism/$1:$3,$1:$DOCKER_TAG-$3 from docker/${1/-//}$4/Dockerfile..." echo "build tags: $DOCKER_TAG-$3, $3"
if [[ $5 ]]; then if [[ $5 ]]; then
echo "extra params: $5" echo "build params: $5"
fi fi
docker buildx build \ docker buildx build \
@ -88,7 +91,8 @@ elif [[ $4 ]]; then
-t photoprism/$1:$DOCKER_TAG-$3 $5 \ -t photoprism/$1:$DOCKER_TAG-$3 $5 \
--push . --push .
else else
echo "docker/buildx-multi: building photoprism/$1:$3 from docker/${1/-//}/Dockerfile..." echo "build tags: $3"
docker buildx build \ docker buildx build \
--platform $2 \ --platform $2 \
--pull \ --pull \

View file

@ -4,7 +4,7 @@
export DOCKER_BUILDKIT=1 export DOCKER_BUILDKIT=1
if [[ -z $1 ]] || [[ -z $2 ]]; then if [[ -z $1 ]] || [[ -z $2 ]]; then
echo "usage: scripts/docker/buildx.sh [image] linux/[amd64|arm64|arm] [tag] [/subimage]" 1>&2 echo "Usage: scripts/docker/buildx.sh [name] linux/[amd64|arm64|arm] [tag] [/subimage]" 1>&2
exit 1 exit 1
fi fi
@ -12,8 +12,11 @@ NUMERIC='^[0-9]+$'
GOPROXY=${GOPROXY:-'https://proxy.golang.org,direct'} GOPROXY=${GOPROXY:-'https://proxy.golang.org,direct'}
DOCKER_TAG=$(date -u +%Y%m%d) DOCKER_TAG=$(date -u +%Y%m%d)
echo "docker/buildx: building photoprism/$1 from docker/${1/-//}$4/Dockerfile..."
if [[ $1 ]] && [[ $2 ]] && [[ -z $3 || $3 == "preview" ]]; then if [[ $1 ]] && [[ $2 ]] && [[ -z $3 || $3 == "preview" ]]; then
echo "docker/buildx: building photoprism/$1:preview from docker/${1/-//}$4/Dockerfile..." echo "build tags: preview"
docker buildx build \ docker buildx build \
--platform $2 \ --platform $2 \
--pull \ --pull \
@ -25,10 +28,10 @@ if [[ $1 ]] && [[ $2 ]] && [[ -z $3 || $3 == "preview" ]]; then
-t photoprism/$1:preview \ -t photoprism/$1:preview \
--push . --push .
elif [[ $3 =~ $NUMERIC ]]; then elif [[ $3 =~ $NUMERIC ]]; then
echo "docker/buildx: building photoprism/$1:$3,$1:latest from docker/${1/-//}$4/Dockerfile..." echo "build tags: $3, latest"
if [[ $5 ]]; then if [[ $5 ]]; then
echo "extra params: $5" echo "build params: $5"
fi fi
docker buildx build \ docker buildx build \
@ -43,10 +46,10 @@ elif [[ $3 =~ $NUMERIC ]]; then
-t photoprism/$1:$3 $5 \ -t photoprism/$1:$3 $5 \
--push . --push .
elif [[ $4 ]] && [[ $3 == *"preview"* ]]; then elif [[ $4 ]] && [[ $3 == *"preview"* ]]; then
echo "docker/buildx: building photoprism/$1:$3 from docker/${1/-//}$4/Dockerfile..." echo "build tags: $3"
if [[ $5 ]]; then if [[ $5 ]]; then
echo "extra params: $5" echo "build params: $5"
fi fi
docker buildx build \ docker buildx build \
@ -60,10 +63,10 @@ elif [[ $4 ]] && [[ $3 == *"preview"* ]]; then
-t photoprism/$1:$3 $5 \ -t photoprism/$1:$3 $5 \
--push . --push .
else else
echo "docker/buildx: building photoprism/$1:$3,$1:$DOCKER_TAG-$3 from docker/${1/-//}$4/Dockerfile..." echo "build tags: $DOCKER_TAG-$3, $3"
if [[ $5 ]]; then if [[ $5 ]]; then
echo "extra params: $5" echo "build params: $5"
fi fi
docker buildx build \ docker buildx build \