Skip to content

Commit b7e1e4f

Browse files
author
Jamie Curnow
committed
Use the corresponding s6 binary for the built arch - fixes NginxProxyManager#298
1 parent a1cebb8 commit b7e1e4f

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

docker/Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
FROM --platform=${TARGETPLATFORM:-linux/amd64} jc21/alpine-nginx-full:node
77

8+
ARG TARGETPLATFORM
9+
ARG BUILDPLATFORM
810
ARG BUILD_VERSION
911
ARG BUILD_COMMIT
1012
ARG BUILD_DATE
@@ -22,8 +24,8 @@ RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
2224
ENV NPM_BUILD_VERSION="${BUILD_VERSION}" NPM_BUILD_COMMIT="${BUILD_COMMIT}" NPM_BUILD_DATE="${BUILD_DATE}"
2325

2426
# s6 overlay
25-
RUN curl -L -o /tmp/s6-overlay-amd64.tar.gz "https://github.com/just-containers/s6-overlay/releases/download/v1.22.1.0/s6-overlay-amd64.tar.gz" \
26-
&& tar -xzf /tmp/s6-overlay-amd64.tar.gz -C /
27+
COPY scripts/install-s6 /tmp/install-s6
28+
RUN /tmp/install-s6 "${TARGETPLATFORM}" && rm -f /tmp/install-s6
2729

2830
EXPOSE 80
2931
EXPOSE 81
@@ -43,4 +45,4 @@ RUN rm -rf /etc/services.d/frontend RUN rm -f /etc/nginx/conf.d/dev.conf
4345
VOLUME [ "/data", "/etc/letsencrypt" ]
4446
CMD [ "/init" ]
4547

46-
HEALTHCHECK --interval=5s --timeout=3s CMD /bin/check-health
48+
HEALTHCHECK --interval=5s --timeout=3s CMD /bin/check-health

scripts/install-s6

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash -e
2+
3+
# Note: This script is designed to be run inside a Docker Build for a container
4+
5+
CYAN='\E[1;36m'
6+
YELLOW='\E[1;33m'
7+
BLUE='\E[1;34m'
8+
GREEN='\E[1;32m'
9+
RESET='\E[0m'
10+
11+
S6_OVERLAY_VERSION=1.22.1.0
12+
TARGETPLATFORM=$1
13+
14+
# Determine the correct binary file for the architecture given
15+
case $TARGETPLATFORM in
16+
linux/arm64)
17+
S6_ARCH=aarch64
18+
;;
19+
20+
linux/arm/v7)
21+
S6_ARCH=armhf
22+
;;
23+
24+
*)
25+
S6_ARCH=amd64
26+
;;
27+
esac
28+
29+
echo -e "${BLUE}${CYAN}Installing S6-overlay v${S6_OVERLAY_VERSION} for ${YELLOW}${TARGETPLATFORM} (${S6_ARCH})${RESET}"
30+
31+
curl -L -o "/tmp/s6-overlay-${S6_ARCH}.tar.gz" "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.gz" \
32+
&& tar -xzf "/tmp/s6-overlay-${S6_ARCH}.tar.gz" -C /
33+
34+
echo -e "${BLUE}${GREEN}S6-overlay install Complete${RESET}"

0 commit comments

Comments
 (0)