mirror of
https://github.com/hanzoai/docker-github-actions-runner.git
synced 2026-09-30 21:42:55 +00:00
It turns out that the "python2" package in Ubuntu doesn't touch /usr/bin/python. To get /usr/bin/python pointing to /usr/bin/python2, you are supposed to install the "python" package. I didn't realize this when I made PR #132, and I didn't test thoroughly enough with my own workflows to realize my mistake. This corrects the package name to "python", making python2 the default.
67 lines
2.4 KiB
Docker
67 lines
2.4 KiB
Docker
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:en
|
|
ENV LC_ALL=en_US.UTF-8
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
# hadolint ignore=DL3003,DL4001
|
|
RUN 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 \
|
|
&& locale-gen en_US.UTF-8 \
|
|
&& dpkg-reconfigure locales \
|
|
&& 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 / \
|
|
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ${DOCKER_KEY} \
|
|
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | awk '{print tolower($0)}')/gpg | apt-key add - \
|
|
&& ( add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(lsb_release -is | awk '{print tolower($0)}') $(lsb_release -cs) 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/*
|