diff --git a/Dockerfile.almalinux b/Dockerfile.almalinux index 093d7bd..88aef1f 100644 --- a/Dockerfile.almalinux +++ b/Dockerfile.almalinux @@ -14,11 +14,10 @@ COPY ${RUNNERPATCH} /tmp/runner.patch RUN cd /tmp && \ git clone -q ${RUNNERREPO} && \ cd runner && \ - git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) -b build && \ - git apply /tmp/runner.patch && \ - sed -i'' -e 's/"version": "8[^"]*"/"version": "'${SDK_VERSION}'"/' src/global.json && \ - sed -i'' -e 's/"version": "8[^"]*"/"version": "'${SDK_VERSION}'"/' .devcontainer/devcontainer.json && \ - sed -i'' -e 's/DOTNETSDK_VERSION="8[^"]*"/DOTNETSDK_VERSION="'${SDK_VERSION}'"/' src/dev.sh + git checkout main -b build && \ + # git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) -b build && \ + sed -i'' -e /version/s/8......\"$/${SDK}.0.100\"/ src/global.json && \ + git apply /tmp/runner.patch RUN cd /tmp/runner/src && \ ./dev.sh layout && \ diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index 30c45ba..22c27f0 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -1,16 +1,14 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.10 ARG RUNNERREPO="https://github.com/actions/runner" RUNNERPATCH SDK_VERSION ARCH ENV DEBIAN_FRONTEND=noninteractive RUN apt-get -qq update -y && \ - apt-get -qq -y install wget git sudo alien curl && \ + apt-get -qq -y install wget git sudo curl dotnet-sdk-8.0 && \ apt autoclean -RUN apt-get -qq -y install dotnet-sdk-8.0 && \ - SDK_VERSION=`dotnet --version` && \ - echo "Using SDK - ${SDK_VERSION}" +RUN echo "Using SDK - `dotnet --version`" ADD ${RUNNERPATCH} /tmp/runner.patch diff --git a/build-files/build-image.sh b/build-files/build-image.sh index fc637dc..560c396 100755 --- a/build-files/build-image.sh +++ b/build-files/build-image.sh @@ -92,7 +92,8 @@ install_runner() { cleanup() { rm -rf /home/ubuntu/build-image.sh /home/ubuntu/runner-sdk-8.patch \ - /tmp/runner /tmp/preseed-yaml + /tmp/runner /tmp/preseed-yaml /home/ubuntu/.nuget \ + /home/ubuntu/.local/share } run() { diff --git a/build-files/install-packages.sh b/build-files/install-packages.sh index 0f923e7..6e40c6d 100644 --- a/build-files/install-packages.sh +++ b/build-files/install-packages.sh @@ -27,34 +27,27 @@ fi header "Installing additional packages" # Update the package list msg "Updating package list..." -sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update -y - -# installing docker -for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done - -# Add Docker's official GPG key: -sudo DEBIAN_FRONTEND=noninteractive apt-get update -y -sudo DEBIAN_FRONTEND=noninteractive apt-get install ca-certificates curl -y -sudo install -m 0755 -d /etc/apt/keyrings -sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc -sudo chmod a+r /etc/apt/keyrings/docker.asc - -# Add the repository to Apt sources: -echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - sudo tee /etc/apt/sources.list.d/docker.list > /dev/null -sudo DEBIAN_FRONTEND=noninteractive apt-get update -y - -sudo DEBIAN_FRONTEND=noninteractive apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y +sudo DEBIAN_FRONTEND=noninteractive apt-get update -y >/dev/null # Read the file line by line and install each package +OK=`true` while IFS= read -r package || [ -n "$package" ]; do if [[ ! -z "$package" && "$package" != \#* ]]; then echo "Installing $package..." - sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install -y "$package" + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install -y "$package" >/dev/null + if [ $? -ne 0 ]; then + OK=`false` + fi sudo dpkg --configure -a fi done < "$PACKAGE_LIST_FILE" -msg "All packages from $PACKAGE_LIST_FILE have been installed." +if [ ${OK} ]; then + msg "All packages from $PACKAGE_LIST_FILE have been installed." +else + msg "NOT all packages from $PACKAGE_LIST_FILE have been installed - check log." +fi + +# Removing the packaging cache +sudo rm -rf /var/cache/apt/archives /var/lib/apt/lists/* +sudo apt-get clean diff --git a/build-files/supported_packages.txt b/build-files/supported_packages.txt index 31586a7..336718d 100644 --- a/build-files/supported_packages.txt +++ b/build-files/supported_packages.txt @@ -24,56 +24,60 @@ packages-microsoft-prod parallel patchelf php-pear -php8.1 -php8.1-amqp -php8.1-apcu -php8.1-bcmath -php8.1-bz2 -php8.1-cgi -php8.1-cli -php8.1-common -php8.1-curl -php8.1-dba -php8.1-dev -php8.1-enchant -php8.1-fpm -php8.1-gd -php8.1-gmp -php8.1-igbinary -php8.1-imagick -php8.1-imap -php8.1-interbase -php8.1-intl -php8.1-ldap -php8.1-mbstring -php8.1-memcache -php8.1-memcached -php8.1-mongodb -php8.1-msgpack -php8.1-mysql -php8.1-odbc -php8.1-opcache -php8.1-pcov -php8.1-pgsql -php8.1-phpdbg -php8.1-pspell -php8.1-readline -php8.1-redis -php8.1-snmp -php8.1-soap -php8.1-sqlite3 -php8.1-sybase -php8.1-tidy -php8.1-xdebug -php8.1-xml -php8.1-xsl -php8.1-yaml -php8.1-zip -php8.1-zmq +php8.3 +php8.3-amqp +php8.3-apcu +php8.3-bcmath +php8.3-bz2 +php8.3-cgi +php8.3-cli +php8.3-common +php8.3-curl +php8.3-dba +php8.3-dev +php8.3-enchant +php8.3-fpm +php8.3-gd +php8.3-gmp +php8.3-igbinary +php8.3-imagick +php8.3-imap +php8.3-interbase +php8.3-intl +php8.3-ldap +php8.3-mbstring +php8.3-memcache +php8.3-memcached +php8.3-mongodb +php8.3-msgpack +php8.3-mysql +php8.3-odbc +php8.3-opcache +php8.3-pcov +php8.3-pgsql +php8.3-phpdbg +php8.3-pspell +php8.3-readline +php8.3-redis +php8.3-snmp +php8.3-soap +php8.3-sqlite3 +php8.3-sybase +php8.3-tidy +php8.3-xdebug +php8.3-xml +php8.3-xsl +php8.3-yaml +php8.3-zip +php8.3-zmq pigz pipx pkg-config podman +podman-compose +podman-docker +podman-remote +podman-toolbox pollinate postgresql-16 powershell-lts @@ -127,4 +131,4 @@ xz-utils yarn zip zlib1g-dev -zsync \ No newline at end of file +zsync diff --git a/setup-build-env.sh b/setup-build-env.sh index 5c1adb7..47de1cb 100755 --- a/setup-build-env.sh +++ b/setup-build-env.sh @@ -67,7 +67,7 @@ build_image_in_container() { msg "Copy the build-image script into gha-builder" lxc file push --mode 0755 "${BUILD_PREREQS_PATH}/install-packages.sh" "${BUILD_CONTAINER}${BUILD_HOME}/install-packages.sh" - msg "Copy the build-image script into gha-builder" + msg "Copy the supported packages list into the gha-builder" lxc file push --mode 0755 "${BUILD_PREREQS_PATH}/supported_packages.txt" "${BUILD_CONTAINER}${BUILD_HOME}/supported_packages.txt" msg "Copy the patch file into gha-builder" @@ -85,6 +85,10 @@ build_image_in_container() { msg "Copy the gha-service unit file into gha-builder" lxc file push ${BUILD_PREREQS_PATH}/gha-runner.service "${BUILD_CONTAINER}/etc/systemd/system/gha-runner.service" + msg "Copy the apt and dpkg overrides into gha-builder - these prevent doc files from being installed" + lxc file push --mode 0644 "${BUILD_PREREQS_PATH}/99synaptics" "${BUILD_CONTAINER}/etc/apt/apt.conf.d/99synaptics" + lxc file push --mode 0644 "${BUILD_PREREQS_PATH}/01_nodoc" "${BUILD_CONTAINER}/etc/dpk/dpkg.cfg.d/01_nodoc" + msg "Setting user ubuntu with sudo privileges" lxc exec "${BUILD_CONTAINER}" --user 0 --group 0 -- sh -c "echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' | sudo EDITOR='tee -a' visudo" @@ -103,7 +107,6 @@ build_image_in_container() { msg "Runner build complete. Creating image snapshot." lxc snapshot "${BUILD_CONTAINER}" "build-snapshot" lxc publish "${BUILD_CONTAINER}/build-snapshot" -f --alias "${IMAGE_ALIAS}" \ - --compression none \ description="GitHub Actions ${OS_NAME} ${OS_VERSION} Runner for ${ARCH}" msg "Export the image to ${EXPORT} for use elsewhere"