Skip to content

Commit df0c0e0

Browse files
committed
Docker: Add s6-overlay to ARMv7 and Ubuntu Jammy based images photoprism#4767
Signed-off-by: Michael Mayer <[email protected]>
1 parent 0709e94 commit df0c0e0

File tree

6 files changed

+30
-27
lines changed

6 files changed

+30
-27
lines changed

docker/develop/armv7/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \
3636
GOBIN="/usr/local/bin" \
3737
GO111MODULE="on" \
3838
CGO_CFLAGS="-g -O2 -Wno-return-local-addr" \
39-
PROG="photoprism"
39+
PROG="photoprism" \
40+
S6_KEEP_ENV=1 \
41+
S6_LOGGING=0
4042

4143
# Copy scripts and package sources config.
4244
COPY --chown=root:root --chmod=755 /scripts/dist/ /scripts/
@@ -82,6 +84,7 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
8284
/photoprism/storage/backups \
8385
/photoprism/storage/config \
8486
/photoprism/storage/cache && \
87+
/scripts/install-s6.sh && \
8588
/scripts/cleanup.sh
8689

8790
# Download machine learning models and test data.
@@ -106,6 +109,6 @@ EXPOSE 2342 2343 2442 2443 9515 40000
106109
# Declare container entrypoint script.
107110
ENTRYPOINT ["/scripts/entrypoint.sh"]
108111

109-
# Keep container running.
110-
CMD ["tail", "-f", "/dev/null"]
111-
112+
# Set default entrypoint and command.
113+
ENTRYPOINT ["/init"]
114+
CMD ["/scripts/cmd.sh", "tail", "-f", "/dev/null"]

docker/develop/jammy-slim/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \
3131
DEBIAN_FRONTEND="noninteractive" \
3232
TF_CPP_MIN_LOG_LEVEL="2" \
3333
MALLOC_ARENA_MAX="4" \
34-
PROG="photoprism"
34+
PROG="photoprism" \
35+
S6_KEEP_ENV=1 \
36+
S6_LOGGING=0
3537

3638
# Copy scripts and package sources config.
3739
COPY --chown=root:root --chmod=755 /scripts/dist/ /scripts/
@@ -68,6 +70,7 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
6870
/photoprism/storage/backups \
6971
/photoprism/storage/config \
7072
/photoprism/storage/cache && \
73+
/scripts/install-s6.sh && \
7174
/scripts/cleanup.sh
7275

7376
# Set default working directory.
@@ -76,5 +79,6 @@ WORKDIR /photoprism
7679
# Expose HTTP and HTTPS ports.
7780
EXPOSE 2342 2442 2443
7881

79-
# Keep container running.
80-
CMD ["tail", "-f", "/dev/null"]
82+
# Set default entrypoint and command.
83+
ENTRYPOINT ["/init"]
84+
CMD ["/scripts/cmd.sh", "tail", "-f", "/dev/null"]

docker/develop/jammy/Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \
3636
GOBIN="/usr/local/bin" \
3737
GO111MODULE="on" \
3838
CGO_CFLAGS="-g -O2 -Wno-return-local-addr" \
39-
PROG="photoprism"
39+
PROG="photoprism" \
40+
S6_KEEP_ENV=1 \
41+
S6_LOGGING=0
4042

4143
# Copy scripts and package sources config.
4244
COPY --chown=root:root --chmod=755 /scripts/dist/ /scripts/
@@ -92,6 +94,7 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
9294
/photoprism/storage/backups \
9395
/photoprism/storage/config \
9496
/photoprism/storage/cache && \
97+
/scripts/install-s6.sh && \
9598
/scripts/cleanup.sh
9699

97100
# Download machine learning models and test data.
@@ -113,8 +116,6 @@ WORKDIR "/go/src/github.com/photoprism/photoprism"
113116
# - 40000 (Go Debugger)
114117
EXPOSE 2342 2343 2442 2443 9515 40000
115118

116-
# Declare container entrypoint script.
117-
ENTRYPOINT ["/scripts/entrypoint.sh"]
118-
119-
# Keep container running.
120-
CMD ["tail", "-f", "/dev/null"]
119+
# Set default entrypoint and command.
120+
ENTRYPOINT ["/init"]
121+
CMD ["/scripts/cmd.sh", "tail", "-f", "/dev/null"]

docker/photoprism/armv7/Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \
9090
PHOTOPRISM_PNG_SIZE=7680 \
9191
PHOTOPRISM_AUTO_INDEX="300" \
9292
PHOTOPRISM_AUTO_IMPORT="-1" \
93-
PHOTOPRISM_INIT="https"
93+
PHOTOPRISM_INIT="https" \
94+
S6_KEEP_ENV=1 \
95+
S6_LOGGING=0
9496

9597
# Copy dist files, scripts, and debian backports sources list.
9698
COPY --from=build --chown=root:root --chmod=755 /opt/photoprism/ /opt/photoprism
@@ -127,6 +129,7 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
127129
/photoprism/storage/backups \
128130
/photoprism/storage/config \
129131
/photoprism/storage/cache && \
132+
/scripts/install-s6.sh && \
130133
/scripts/cleanup.sh
131134

132135
# Set default working directory.
@@ -135,8 +138,6 @@ WORKDIR /photoprism
135138
# Expose HTTP(S) ports.
136139
EXPOSE 2342 2443
137140

138-
# Declare container entrypoint script.
139-
ENTRYPOINT ["/scripts/entrypoint.sh"]
140-
141-
# Start app.
142-
CMD ["/opt/photoprism/bin/photoprism", "start"]
141+
# Set default entrypoint and command.
142+
ENTRYPOINT ["/init"]
143+
CMD ["/scripts/cmd.sh", "/opt/photoprism/bin/photoprism", "start"]

docker/photoprism/jammy/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,5 @@ EXPOSE 2342 2443
101101
# Copy app files.
102102
COPY --from=build --chown=root:root --chmod=755 /opt/photoprism/ /opt/photoprism
103103

104-
# Declare container entrypoint script.
105-
ENTRYPOINT ["/scripts/entrypoint.sh"]
106-
107104
# Start app.
108-
CMD ["/opt/photoprism/bin/photoprism", "start"]
105+
CMD ["/scripts/cmd.sh", "/opt/photoprism/bin/photoprism", "start"]

docker/photoprism/oracular/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,5 @@ EXPOSE 2342 2443
101101
# Copy app files.
102102
COPY --from=build --chown=root:root --chmod=755 /opt/photoprism/ /opt/photoprism
103103

104-
# Declare container entrypoint script.
105-
ENTRYPOINT ["/scripts/entrypoint.sh"]
106-
107104
# Start app.
108-
CMD ["/opt/photoprism/bin/photoprism", "start"]
105+
CMD ["/scripts/cmd.sh", "/opt/photoprism/bin/photoprism", "start"]

0 commit comments

Comments
 (0)