forked from myoung34/docker-github-actions-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.base
70 lines (67 loc) · 2.63 KB
/
Dockerfile.base
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
FROM ubuntu:focal
LABEL maintainer="[email protected]"
# TODO: Ubuntu focal (20.04) has git v2.25, but the minimum needed for GitHub
# Actions runners is v2.29. For now, we build git from source. When updating
# to hirsute (21.04) or later, we can remove the instructions to build from
# source in favor of the regular Ubuntu git package.
ARG GIT_VERSION="2.29.0"
ARG DUMB_INIT_VERSION="1.2.2"
ARG DOCKER_KEY="7EA0A9C3F273FCD8"
ENV DOCKER_COMPOSE_VERSION="1.27.4"
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
# hadolint ignore=DL3003,DL4001
RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
awscli \
curl \
tar \
unzip \
apt-transport-https \
ca-certificates \
sudo \
gpg-agent \
gnupg \
software-properties-common \
build-essential \
zlib1g-dev \
zstd \
gettext \
liblttng-ust0 \
libcurl4-openssl-dev \
inetutils-ping \
jq \
wget \
dirmngr \
openssh-client \
locales \
python3-pip \
python \
dumb-init \
&& pip3 install --no-cache-dir awscliv2 \
&& c_rehash \
&& cd /tmp \
&& curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz \
&& tar zxf git.tgz \
&& cd git-${GIT_VERSION} \
&& ./configure --prefix=/usr \
&& make \
&& make install \
&& cd / \
# Determine the Distro name (Debian, Ubuntu, etc)
&& distro=$(lsb_release -is | awk '{print tolower($0)}') \
# Determine the Distro version (bullseye, xenial, etc)
# Note: sid is aliased to bullseye, because Docker doesn't have a matching apt repo
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ${DOCKER_KEY} \
&& curl -fsSL https://download.docker.com/linux/${distro}/gpg | apt-key add - \
&& version=$(lsb_release -cs | awk '{gsub("sid", "bullseye"); print $0}') \
&& ( add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/${distro} ${version} stable" ) \
&& apt-get update \
&& apt-get install -y docker-ce docker-ce-cli containerd.io --no-install-recommends --allow-unauthenticated \
&& [[ $(lscpu -J | jq -r '.lscpu[] | select(.field == "Vendor ID:") | .data') == "ARM" ]] && echo "Not installing docker-compose. See https://github.com/docker/compose/issues/6831" || ( curl -sL "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 ) \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*