From 5ee00700e7e43f132c29bc1c22ccabc4f310b557 Mon Sep 17 00:00:00 2001 From: Andrew Ying Date: Sun, 17 Nov 2024 19:39:28 +0000 Subject: [PATCH] Initial commit --- .dockerignore | 4 ++ .gitignore | 1 + LICENSE.md | 24 +++++++++ README.md | 17 ++++++ ubuntu-jammy/Dockerfile | 112 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 158 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 ubuntu-jammy/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3fc687f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +.idea +LICENSE.md +README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..92e9646 --- /dev/null +++ b/LICENSE.md @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..efe1313 --- /dev/null +++ b/README.md @@ -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). diff --git a/ubuntu-jammy/Dockerfile b/ubuntu-jammy/Dockerfile new file mode 100644 index 0000000..e56a6ba --- /dev/null +++ b/ubuntu-jammy/Dockerfile @@ -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