Initial commit

This commit is contained in:
Andrew Ying 2024-11-17 19:39:28 +00:00
commit 5ee00700e7
Signed by: andrew
SSH key fingerprint: SHA256:6goOJXI6ckOipdsJS6oj5gbQYaRmCe37r7bSBnyQLyE
5 changed files with 158 additions and 0 deletions

4
.dockerignore Normal file
View file

@ -0,0 +1,4 @@
.git
.idea
LICENSE.md
README.md

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.idea

24
LICENSE.md Normal file
View file

@ -0,0 +1,24 @@
Copyright © 2024 Witine Limited and subsidiaries.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

17
README.md Normal file
View file

@ -0,0 +1,17 @@
# Git actions runner images
This is a work in progress. This package is unstable and may not work as
expected, or may not work at all. Use this package at your own risk.
## Postcardware
You're free to use this package, but if it makes it to your production
environment, we'd really appreciate you sending us a postcard, mentioning which
of our package(s) you are using.
Our address is: Witine Limited, St John's Innovation Centre, Cowley Road,
Cambridge CB4 0WS, United Kingdom
## License
This package is licensed under the [3-clause BSD License](LICENSE.md).

112
ubuntu-jammy/Dockerfile Normal file
View file

@ -0,0 +1,112 @@
ARG PYTHON_VERSION=3.12.0
ARG PYTHON_VERSION_SHORT=3.12
FROM ubuntu:22.04 AS python_build
ARG PYTHON_VERSION
ARG PYTHON_VERSION_SHORT
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root
RUN apt-get update -y \
&& apt-get install --no-install-recommends --no-install-suggests -y \
ca-certificates \
curl \
gcc \
gnupg \
libbz2-dev \
libev-dev \
libffi-dev \
libgdbm-dev \
liblzma-dev \
libncurses-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
make \
tk-dev \
wget \
zlib1g-dev
RUN set -x \
&& mkdir -p /root/build \
&& cd /root/build \
&& curl -O https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz \
&& tar -xvzf Python-${PYTHON_VERSION}.tgz \
&& cd Python-${PYTHON_VERSION} \
&& ./configure \
--prefix=/usr/lib/python${PYTHON_VERSION_SHORT} \
--enable-optimizations \
&& make
FROM ubuntu:22.04
ARG PYTHON_VERSION
ARG PYTHON_VERSION_SHORT
ENV NODEJS_VERSION=22.x
ENV NVM_VERSION=0.40.1
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y \
&& apt-get install --no-install-recommends --no-install-suggests -y \
apt-transport-https \
ca-certificates \
curl \
gcc \
git \
git-lfs \
gnupg \
libbz2-1.0 \
libev4 \
libffi8 \
libgdbm6 \
liblzma5 \
libncurses6 \
libreadline8 \
libsqlite3-0 \
make \
openssl \
sudo \
vim
RUN adduser --home /home/runner --shell /bin/bash --disabled-password runner \
&& adduser runner sudo \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN set -x \
&& mkdir -p /usr/share/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg \
&& chmod 644 /usr/share/keyrings/nodesource.gpg \
&& arch=$(dpkg --print-architecture) \
&& echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODEJS_VERSION} nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null \
&& apt-get update -y \
&& apt-get install --no-install-recommends --no-install-suggests -y nodejs \
&& npm install --global yarn \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash
COPY --from=python_build /root/build /tmp/build
RUN set -x \
&& cd /tmp/build/Python-${PYTHON_VERSION} \
&& make install \
&& cd ../ \
&& rm -f Python-${PYTHON_VERSION} \
&& ln -s /usr/lib/python${PYTHON_VERSION_SHORT}/bin/python${PYTHON_VERSION_SHORT} /usr/local/bin/python${PYTHON_VERSION_SHORT} \
&& ln -s /usr/local/bin/python${PYTHON_VERSION_SHORT} /usr/local/bin/python3 \
&& curl -O https://bootstrap.pypa.io/get-pip.py \
&& python3 get-pip.py \
&& rm get-pip.py \
&& python3 -m pip install \
ansible \
virtualenv
RUN curl -sSL -O https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update -y \
&& apt-get install --no-install-recommends --no-install-suggests -y azcopy
USER runner
WORKDIR /home/runner