-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
49 lines (40 loc) · 1.48 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ARG BASE_IMAGE=ubuntu:22.04
# build image
FROM ${BASE_IMAGE} as build
ARG S6_DIR=/opt/s6/
ARG S6_SRC_DEP="xz-utils wget"
ARG S6_SRC_URL="https://github.com/just-containers/s6-overlay/releases/download"
ENV DEBIAN_FRONTEND="noninteractive" \
S6_KEEP_ENV=1
# install S6 Overlay
COPY s6-overlay_version.txt /tmp/s6-overlay_version.txt
RUN S6_VERSION=$(cat /tmp/s6-overlay_version.txt); \
mkdir -p $S6_DIR; \
apt-get update; \
apt-get install -yq $S6_SRC_DEP --no-install-recommends --no-install-suggests; \
export SYS_ARCH=$(uname -m); \
case "$SYS_ARCH" in \
aarch64 ) export S6_ARCH='aarch64' ;; \
arm64 ) export S6_ARCH='aarch64' ;; \
armhf ) export S6_ARCH='armhf' ;; \
arm* ) export S6_ARCH='arm' ;; \
i4* ) export S6_ARCH='i486' ;; \
i6* ) export S6_ARCH='i686' ;; \
s390* ) export S6_ARCH='s390x' ;; \
* ) export S6_ARCH='x86_64' ;; \
esac; \
untar (){ \
echo "⏬ Downloading $1"; \
wget --no-check-certificate -O- $1 | tar Jxp -C $S6_DIR; \
}; \
\
echo "⬇️ Downloading s6 overlay:${S6_ARCH}-${S6_VERSION} for ${SYS_ARCH}" \
&& untar ${S6_SRC_URL}/${S6_VERSION}/s6-overlay-noarch.tar.xz \
&& untar ${S6_SRC_URL}/${S6_VERSION}/s6-overlay-${S6_ARCH}.tar.xz
# main image
FROM ${BASE_IMAGE}
LABEL maintainer="@jaydrogers"
ENV DEBIAN_FRONTEND="noninteractive" \
S6_KEEP_ENV=1
COPY --from=build /opt/s6/ /
ENTRYPOINT ["/init"]