-
-
Notifications
You must be signed in to change notification settings - Fork 321
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (64 loc) · 3 KB
/
Dockerfile
File metadata and controls
72 lines (64 loc) · 3 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# syntax=docker/dockerfile:1
## Buildstage ##
FROM ghcr.io/linuxserver/baseimage-alpine:3.23 AS buildstage
ARG MOD_VERSION
RUN \
echo "**** retrieve latest version ****" && \
if [ -z "${MOD_VERSION}" ]; then \
DOCKER_RELEASE=$(curl -sX GET "https://api.github.com/repos/moby/moby/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]' \
| sed 's|^docker-||' \
| sed 's|^v||'); \
COMPOSE_RELEASE=$(curl -sX GET "https://api.github.com/repos/docker/compose/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]' \
| sed 's|^v||'); \
else \
DOCKER_RELEASE=$(echo "${MOD_VERSION}" | sed 's|-.*||'); \
COMPOSE_RELEASE=$(echo "${MOD_VERSION}" | sed 's|.*-||'); \
fi && \
echo "**** retrieve latest compose switch version ****" && \
SWITCH_RELEASE=$(curl -sX GET "https://api.github.com/repos/docker/compose-switch/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]' \
| sed 's|^v||') && \
echo "**** retrieve latest buildx version ****" && \
BUILDX_RELEASE=$(curl -sX GET "https://api.github.com/repos/docker/buildx/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
mkdir -p /root-layer/docker-tgz && \
if [ $(uname -m) = "x86_64" ]; then \
echo "**** grab x86_64 tarballs and binaries ****" && \
curl -fo \
/root-layer/docker-tgz/docker.tgz -L \
"https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_RELEASE}.tgz" && \
curl -fo \
/root-layer/docker-tgz/docker-compose -L \
"https://github.com/docker/compose/releases/download/v${COMPOSE_RELEASE}/docker-compose-linux-x86_64" && \
curl -fo \
/root-layer/docker-tgz/compose-switch -L \
"https://github.com/docker/compose-switch/releases/download/v${SWITCH_RELEASE}/docker-compose-linux-amd64" && \
curl -fo \
/root-layer/docker-tgz/docker-buildx -L \
"https://github.com/docker/buildx/releases/download/${BUILDX_RELEASE}/buildx-${BUILDX_RELEASE}.linux-amd64"; \
elif [ $(uname -m) = "aarch64" ]; then \
echo "**** grab aarch64 tarballs and binaries ****" && \
curl -fo \
/root-layer/docker-tgz/docker.tgz -L \
"https://download.docker.com/linux/static/stable/aarch64/docker-${DOCKER_RELEASE}.tgz" && \
curl -fo \
/root-layer/docker-tgz/docker-compose -L \
"https://github.com/docker/compose/releases/download/v${COMPOSE_RELEASE}/docker-compose-linux-aarch64" && \
curl -fo \
/root-layer/docker-tgz/compose-switch -L \
"https://github.com/docker/compose-switch/releases/download/v${SWITCH_RELEASE}/docker-compose-linux-arm64" && \
curl -fo \
/root-layer/docker-tgz/docker-buildx -L \
"https://github.com/docker/buildx/releases/download/${BUILDX_RELEASE}/buildx-${BUILDX_RELEASE}.linux-arm64"; \
fi && \
chmod +x /root-layer/docker-tgz/* && \
rm -rf /tmp/*
# copy local files
COPY root/ /root-layer/
## Single layer deployed image ##
FROM scratch
LABEL maintainer="aptalca"
# Add files from buildstage
COPY --from=buildstage /root-layer/ /