-
-
Notifications
You must be signed in to change notification settings - Fork 90
/
Dockerfile
62 lines (53 loc) · 2.31 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
54
55
56
57
58
59
60
61
62
ARG UBUNTU_VERSION="24.04"
FROM ubuntu:${UBUNTU_VERSION}
ARG UBUNTU_VERSION
ENV DOCKER_CHANNEL=stable \
DOCKER_VERSION=27.4.1 \
DOCKER_COMPOSE_VERSION=v2.32.0 \
BUILDX_VERSION=v0.19.1 \
DEBUG=false
# Install common dependencies
RUN set -eux; \
apt-get update && apt-get install -y \
ca-certificates wget curl iptables supervisor \
&& rm -rf /var/lib/apt/lists/*
# Set iptables-legacy for Ubuntu 22.04 and newer
RUN set -eux; \
if [ "${UBUNTU_VERSION}" != "20.04" ]; then \
update-alternatives --set iptables /usr/sbin/iptables-legacy; \
fi
# Install Docker and buildx
RUN set -eux; \
arch="$(uname -m)"; \
case "$arch" in \
x86_64) dockerArch='x86_64' ; buildx_arch='linux-amd64' ;; \
armhf) dockerArch='armel' ; buildx_arch='linux-arm-v6' ;; \
armv7) dockerArch='armhf' ; buildx_arch='linux-arm-v7' ;; \
aarch64) dockerArch='aarch64' ; buildx_arch='linux-arm64' ;; \
*) echo >&2 "error: unsupported architecture ($arch)"; exit 1 ;; \
esac && \
wget -O docker.tgz "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/${dockerArch}/docker-${DOCKER_VERSION}.tgz" && \
tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ && \
rm docker.tgz && \
wget -O docker-buildx "https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.${buildx_arch}" && \
mkdir -p /usr/local/lib/docker/cli-plugins && \
chmod +x docker-buildx && \
mv docker-buildx /usr/local/lib/docker/cli-plugins/docker-buildx && \
dockerd --version && \
docker --version && \
docker buildx version
COPY modprobe start-docker.sh entrypoint.sh /usr/local/bin/
COPY supervisor/ /etc/supervisor/conf.d/
COPY logger.sh /opt/bash-utils/logger.sh
RUN chmod +x /usr/local/bin/start-docker.sh \
/usr/local/bin/entrypoint.sh \
/usr/local/bin/modprobe
VOLUME /var/lib/docker
# Install Docker Compose
RUN set -eux; \
curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose && \
docker-compose version && \
ln -s /usr/local/bin/docker-compose /usr/local/lib/docker/cli-plugins/docker-compose
ENTRYPOINT ["entrypoint.sh"]
CMD ["bash"]