@@ -3,13 +3,14 @@ FROM alpine:latest as acmesh_artifacts
3
3
# os related operations below:
4
4
RUN apk -U --no-cache upgrade
5
5
6
- RUN apk add --no-cache curl gzip tar
6
+ RUN apk add --no-cache curl gzip tar util-linux xz
7
7
8
8
# Set ARGS
9
9
ARG acmesh_version=master
10
10
ARG acmesh_link="https://github.com/acmesh-official/acme.sh/archive/${acmesh_version}.tar.gz"
11
11
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
13
14
14
15
# Download and place acme.sh inside the container
15
16
RUN mkdir -p "${acmesh_artifacts_dir}" \
@@ -18,18 +19,36 @@ RUN mkdir -p "${acmesh_artifacts_dir}" \
18
19
&& rm -rf "/tmp/acmesh-${acmesh_version}.tar.gz" \
19
20
&& "${acmesh_artifacts_dir}" /acme.sh --help
20
21
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
24
42
25
43
FROM alpine:latest
26
44
27
45
ARG acmesh_artifacts_dir=/opt/acmesh
28
46
ARG auto_upgrade=0
29
47
ARG acme_working_dir=/usr/lib/acmesh
48
+ ARG s6_artifacts_dir=/opt/s6
30
49
31
50
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 " "/"
33
52
34
53
# Set runtime variables
35
54
ENV LE_WORKING_DIR="$acme_working_dir"
@@ -49,10 +68,7 @@ RUN apk add --no-cache bash wget curl git openssl shadow socat \
49
68
&& apk -U --no-cache upgrade \
50
69
&& cd "$acmesh_artifacts_dir" || exit \
51
70
&& ./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"
56
72
57
73
COPY root/ /
58
74
0 commit comments