Skip to content

Commit 7f86357

Browse files
committed
Upgrading s6 in alpine to 3.0.0.2-2
* Installation method is being updated
1 parent aa0dc92 commit 7f86357

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

alpinelinux/Dockerfile

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ FROM alpine:latest as acmesh_artifacts
33
# os related operations below:
44
RUN apk -U --no-cache upgrade
55

6-
RUN apk add --no-cache curl gzip tar
6+
RUN apk add --no-cache curl gzip tar util-linux xz
77

88
# Set ARGS
99
ARG acmesh_version=master
1010
ARG acmesh_link="https://github.com/acmesh-official/acme.sh/archive/${acmesh_version}.tar.gz"
1111
ARG acmesh_artifacts_dir=/opt/acmesh
12-
ARG s6_overlay_version=2.2.0.3
12+
ARG s6_artifacts_dir=/opt/s6
13+
ARG s6_overlay_version=3.0.0.2-2
1314

1415
# Download and place acme.sh inside the container
1516
RUN mkdir -p "${acmesh_artifacts_dir}" \
@@ -18,18 +19,36 @@ RUN mkdir -p "${acmesh_artifacts_dir}" \
1819
&& rm -rf "/tmp/acmesh-${acmesh_version}.tar.gz" \
1920
&& "${acmesh_artifacts_dir}"/acme.sh --help
2021

21-
# Download and install s6-overlay-builder
22-
ADD https://github.com/just-containers/s6-overlay/releases/download/v${s6_overlay_version}/s6-overlay-amd64-installer /tmp/
23-
RUN chmod +x /tmp/s6-overlay-amd64-installer
22+
# Download s6-overlay artifacts and checksum files
23+
RUN mkdir -p ${s6_artifacts_dir} \
24+
&& CPU_ARCH=$(lscpu | grep Architecture | cut -f2 -d":" | xargs) \
25+
&& echo "CPU ARCH is: ${CPU_ARCH}" \
26+
&& curl --fail --location --remote-header-name --output "/tmp/s6-overlay-noarch.tar.xz" \
27+
https://github.com/just-containers/s6-overlay/releases/download/v${s6_overlay_version}/s6-overlay-noarch-${s6_overlay_version}.tar.xz \
28+
&& curl --fail --location --remote-header-name --output "/tmp/s6-overlay-noarch.tar.xz.sha256" \
29+
https://github.com/just-containers/s6-overlay/releases/download/v${s6_overlay_version}/s6-overlay-noarch-${s6_overlay_version}.tar.xz.sha256 \
30+
&& curl --fail --location --remote-header-name --output "/tmp/s6-overlay.tar.xz" \
31+
https://github.com/just-containers/s6-overlay/releases/download/v${s6_overlay_version}/s6-overlay-x86_64-${s6_overlay_version}.tar.xz \
32+
&& curl --fail --location --remote-header-name --output "/tmp/s6-overlay.tar.xz.sha256" \
33+
https://github.com/just-containers/s6-overlay/releases/download/v${s6_overlay_version}/s6-overlay-${CPU_ARCH}-${s6_overlay_version}.tar.xz.sha256
34+
35+
# Perform checksum on s6-overlay artifacts
36+
RUN echo "$(cat /tmp/s6-overlay-noarch.tar.xz.sha256 | cut -f1 -d" ") /tmp/s6-overlay-noarch.tar.xz" | sha256sum -cs
37+
RUN echo "$(cat /tmp/s6-overlay.tar.xz.sha256| cut -f1 -d" ") /tmp/s6-overlay.tar.xz" | sha256sum -cs
38+
39+
# Extract s6-overlay artifacts
40+
RUN tar -C ${s6_artifacts_dir} --xz --extract --preserve-permissions --file /tmp/s6-overlay-noarch.tar.xz \
41+
&& tar -C ${s6_artifacts_dir} --xz --extract --preserve-permissions --file /tmp/s6-overlay.tar.xz
2442

2543
FROM alpine:latest
2644

2745
ARG acmesh_artifacts_dir=/opt/acmesh
2846
ARG auto_upgrade=0
2947
ARG acme_working_dir=/usr/lib/acmesh
48+
ARG s6_artifacts_dir=/opt/s6
3049

3150
COPY --from=acmesh_artifacts "$acmesh_artifacts_dir" "$acmesh_artifacts_dir"
32-
COPY --from=acmesh_artifacts "/tmp/s6-overlay-amd64-installer" "/tmp/s6-overlay-amd64-installer"
51+
COPY --from=acmesh_artifacts "$s6_artifacts_dir" "/"
3352

3453
# Set runtime variables
3554
ENV LE_WORKING_DIR="$acme_working_dir"
@@ -49,10 +68,7 @@ RUN apk add --no-cache bash wget curl git openssl shadow socat \
4968
&& apk -U --no-cache upgrade \
5069
&& cd "$acmesh_artifacts_dir" || exit \
5170
&& ./acme.sh --install --no-cron --no-profile --auto-upgrade 0 \
52-
&& chmod -R +x "$LE_WORKING_DIR" \
53-
# install s6-overlay
54-
&& /tmp/s6-overlay-amd64-installer / \
55-
&& rm -rf /tmp/s6-overlay-amd64-installer
71+
&& chmod -R +x "$LE_WORKING_DIR"
5672

5773
COPY root/ /
5874

0 commit comments

Comments
 (0)