From f5aee956af799da59b854dc5ce30c086a6d720d6 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Fri, 11 Mar 2022 10:30:18 +0100 Subject: [PATCH] CI: Exclude Docker image scripts from build package #2076 --- Makefile | 7 +++---- docker/photoprism/armv7/Dockerfile | 6 ++---- docker/photoprism/bullseye/Dockerfile | 9 ++++----- docker/photoprism/buster/Dockerfile | 6 ++---- docker/photoprism/impish/Dockerfile | 6 ++---- scripts/dist/.buildignore | 1 - 6 files changed, 13 insertions(+), 22 deletions(-) delete mode 100644 scripts/dist/.buildignore diff --git a/Makefile b/Makefile index 24de560a2..48d3aecef 100644 --- a/Makefile +++ b/Makefile @@ -77,18 +77,17 @@ install: mkdir --mode=$(INSTALL_MODE) -p $(DESTDIR) env TMPDIR="$(BUILD_PATH)" ./scripts/dist/install-tensorflow.sh $(DESTDIR) rm -rf --preserve-root $(DESTDIR)/include - (cd $(DESTDIR) && mkdir -p bin scripts lib assets config config/examples) + (cd $(DESTDIR) && mkdir -p bin lib assets config config/examples) ./scripts/build.sh prod "$(DESTDIR)/bin/$(BINARY_NAME)" [ -f "$(GOBIN)/gosu" ] || go install github.com/tianon/gosu@latest cp $(GOBIN)/gosu $(DESTDIR)/bin/gosu [ ! -f "$(GOBIN)/exif-read-tool" ] || cp $(GOBIN)/exif-read-tool $(DESTDIR)/bin/exif-read-tool rsync -r -l --safe-links --exclude-from=assets/.buildignore --chmod=a+r,u+rw ./assets/ $(DESTDIR)/assets - rsync -r -l --safe-links --exclude-from=scripts/dist/.buildignore --chmod=a+rx,u+rwx ./scripts/dist/ $(DESTDIR)/scripts - mv $(DESTDIR)/scripts/heif-convert.sh $(DESTDIR)/bin/heif-convert + cp scripts/dist/heif-convert.sh $(DESTDIR)/bin/heif-convert cp internal/config/testdata/*.yml $(DESTDIR)/config/examples chown -R $(INSTALL_USER) $(DESTDIR) chmod -R $(INSTALL_MODE) $(DESTDIR) - chmod -R $(INSTALL_MODE_BIN) $(DESTDIR)/bin $(DESTDIR)/lib $(DESTDIR)/scripts/*.sh + chmod -R $(INSTALL_MODE_BIN) $(DESTDIR)/bin $(DESTDIR)/lib @echo "PhotoPrism $(BUILD_TAG) has been successfully installed in \"$(DESTDIR)\".\nEnjoy!" install-go: sudo scripts/dist/install-go.sh diff --git a/docker/photoprism/armv7/Dockerfile b/docker/photoprism/armv7/Dockerfile index 4f6327fb1..ffa5b342b 100644 --- a/docker/photoprism/armv7/Dockerfile +++ b/docker/photoprism/armv7/Dockerfile @@ -74,8 +74,9 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \ PHOTOPRISM_AUTO_INDEX=300 \ PHOTOPRISM_AUTO_IMPORT=300 -# copy dist files and debian backports sources list +# copy dist files, scripts, and debian backports sources list COPY --from=build /opt/photoprism/ /opt/photoprism +COPY --chown=root:root --chmod=755 /scripts/dist/* /scripts/ COPY /docker/develop/bullseye/sources.list /etc/apt/sources.list.d/bullseye.list # install additional distribution packages @@ -84,9 +85,6 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \ echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing && \ - mv -f /opt/photoprism/scripts/ /scripts && \ - chown -R root:root /scripts && \ - chmod -R 755 /scripts && \ cp /opt/photoprism/bin/gosu /bin/gosu && \ chown root:root /bin/gosu && \ groupadd -f -r -g 44 video && groupadd -f -r -g 109 render && groupadd -f -g 1000 photoprism && \ diff --git a/docker/photoprism/bullseye/Dockerfile b/docker/photoprism/bullseye/Dockerfile index 9c69af39f..e7b5a0b46 100644 --- a/docker/photoprism/bullseye/Dockerfile +++ b/docker/photoprism/bullseye/Dockerfile @@ -74,6 +74,9 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \ PHOTOPRISM_AUTO_INDEX=300 \ PHOTOPRISM_AUTO_IMPORT=300 +# copy scripts +COPY --chown=root:root --chmod=755 /scripts/dist/* /scripts/ + # update pre-installed packages if needed RUN apt-get update && \ apt-get -qq dist-upgrade && \ @@ -85,12 +88,8 @@ WORKDIR /photoprism # expose default http port 2342 EXPOSE 2342 -# copy dist files and debian backports sources list +# copy dist files COPY --from=build /opt/photoprism/ /opt/photoprism -RUN cp -f /opt/photoprism/scripts/* /scripts/ && \ - chown -R root:root /scripts && \ - chmod -R 755 /scripts && \ - rm -rf /opt/photoprism/scripts # set container entrypoint script ENTRYPOINT ["/scripts/entrypoint.sh"] diff --git a/docker/photoprism/buster/Dockerfile b/docker/photoprism/buster/Dockerfile index 20e791814..61682a0fc 100644 --- a/docker/photoprism/buster/Dockerfile +++ b/docker/photoprism/buster/Dockerfile @@ -74,8 +74,9 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \ PHOTOPRISM_AUTO_INDEX=300 \ PHOTOPRISM_AUTO_IMPORT=300 -# copy dist files and debian backports sources list +# copy dist files, scripts, and debian backports sources list COPY --from=build /opt/photoprism/ /opt/photoprism +COPY --chown=root:root --chmod=755 /scripts/dist/* /scripts/ COPY --chown=root:root --chmod=644 /docker/develop/buster/sources.list /etc/apt/sources.list.d/buster.list # install additional distribution packages @@ -84,9 +85,6 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \ echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing && \ - mv -f /opt/photoprism/scripts/ /scripts && \ - chown -R root:root /scripts && \ - chmod -R 755 /scripts && \ cp /opt/photoprism/bin/gosu /bin/gosu && \ chown root:root /bin/gosu && \ groupadd -f -r -g 44 video && groupadd -f -r -g 109 render && groupadd -f -g 1000 photoprism && \ diff --git a/docker/photoprism/impish/Dockerfile b/docker/photoprism/impish/Dockerfile index 9ff6ecb66..f06fbebce 100644 --- a/docker/photoprism/impish/Dockerfile +++ b/docker/photoprism/impish/Dockerfile @@ -74,8 +74,9 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \ PHOTOPRISM_AUTO_INDEX=300 \ PHOTOPRISM_AUTO_IMPORT=300 -# copy dist files and debian backports sources list +# copy dist files and scripts COPY --from=build /opt/photoprism/ /opt/photoprism +COPY --chown=root:root --chmod=755 /scripts/dist/* /scripts/ # install additional distribution packages RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ @@ -83,9 +84,6 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \ echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing && \ - mv -f /opt/photoprism/scripts/ /scripts && \ - chown -R root:root /scripts && \ - chmod -R 755 /scripts && \ cp /opt/photoprism/bin/gosu /bin/gosu && \ chown root:root /bin/gosu && \ groupadd -f -r -g 44 video && groupadd -f -r -g 109 render && groupadd -f -g 1000 photoprism && \ diff --git a/scripts/dist/.buildignore b/scripts/dist/.buildignore deleted file mode 100644 index 9abb766ce..000000000 --- a/scripts/dist/.buildignore +++ /dev/null @@ -1 +0,0 @@ -.* \ No newline at end of file