CI: Exclude Docker image scripts from build package #2076

This commit is contained in:
Michael Mayer 2022-03-11 10:30:18 +01:00
parent 2a33af8bab
commit f5aee956af
6 changed files with 13 additions and 22 deletions

View file

@ -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

View file

@ -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 && \

View file

@ -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"]

View file

@ -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 && \

View file

@ -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 && \

View file

@ -1 +0,0 @@
.*