-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (49 loc) · 2.04 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
50
51
52
53
FROM registry.gitlab.com/jitesoft/dockerfiles/alpine:3.14
ARG DOCKER_VERSION
LABEL maintainer="Johannes Tegnér <[email protected]>" \
maintainer.org="Jitesoft" \
maintainer.org.uri="https://jitesoft.com" \
com.jitesoft.project.repo.type="git" \
com.jitesoft.project.repo.uri="https://gitlab.com/jitesoft/dockerfiles/docker" \
com.jitesoft.project.repo.issues="https://gitlab.com/jitesoft/dockerfiles/docker/issues" \
com.jitesoft.project.registry.uri="registry.gitlab.com/jitesoft/dockerfiles/docker" \
com.jitesoft.app.docker.version="${DOCKER_VERSION}"
ENV DOCKER_CLI_EXPERIMENTAL="enabled"
ARG DOCKER_VERSION
ARG TARGETPLATFORM
COPY ./entrypoint.sh /usr/local/bin/
RUN apk add --no-cache ca-certificates git openssh-client \
&& [[ ! -e /etc/nsswitch.conf ]] && echo 'hosts: files dns' > /etc/nsswitch.conf \
&& ARCH=$( \
case "${TARGETPLATFORM}" in \
"linux/amd64") \
echo "x86_64" \
;; \
"linux/arm64") \
echo "aarch64" \
;; \
"linux/arm/v7") \
echo "armhf" \
;; \
"linux/ppc64le") \
echo "ppc64le" \
;; \
"linux/s390x") \
echo "s390x" \
;; \
esac \
) \
&& echo "Architecture: ${TARGETPLATFORM} - ${ARCH}" \
&& cat /etc/apk/arch \
&& wget -O docker.tgz "https://download.docker.com/linux/static/stable/${ARCH}/docker-${DOCKER_VERSION}.tgz" \
&& tar -xzf docker.tgz --strip-components 1 -C /usr/local/bin \
&& chmod +x /usr/local/bin/docker \
&& chmod +x /usr/local/bin/dockerd \
&& chmod +x /usr/local/bin/entrypoint.sh \
&& mkdir -p /root/.docker \
&& echo '{ "experimental": "enabled" }' > /root/.docker/config.json \
&& rm docker.tgz \
&& docker --version \
&& dockerd --version
ENTRYPOINT ["entrypoint.sh"]
CMD ["sh"]