diff --git a/.github/workflows/dockerImagePublish.yml b/.github/workflows/dockerImagePublish.yml index f62c6d7..3b5acaf 100644 --- a/.github/workflows/dockerImagePublish.yml +++ b/.github/workflows/dockerImagePublish.yml @@ -14,23 +14,45 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Build the Docker image - run: docker build . --file Dockerfile --tag image + - name: Free additional disk space + run: | + echo "Initial free space: " + df -h / + sudo rm -rf /usr/local/lib/android + echo "Removed Android SDK: " + df -h / + sudo rm -rf /usr/share/dotnet + echo "Removed .NET runtime: " + df -h / + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + echo "Tool cache cleanup: " + df -h / + sudo docker image prune --all --force + echo "Docker prune: " + df -h / + sudo apt remove -y '^llvm-.*-dev$' '^dotnet-.*' '^openjdk-.*' '.*-jdk$' firefox google-chrome-stable microsoft-edge-stable google-cloud-cli azure-cli mono-devel powershell + sudo apt autoremove -y + sudo apt clean + echo "Package cleanup: " + df -h / + + - uses: actions/checkout@v4 + + - name: Build the container image + run: podman build . --file Dockerfile --tag image --squash-all - name: Log into registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin + run: echo "${{ secrets.GITHUB_TOKEN }}" | podman login ghcr.io -u ${{ github.actor }} --password-stdin - name: Push image run: | # Image ID must be lowercase - IMAGE_ID=docker.pkg.github.com/$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')/$IMAGE_NAME + IMAGE_ID=ghcr.io/$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')/$IMAGE_NAME # Strip git ref prefix from version VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') echo IMAGE_ID=$IMAGE_ID echo VERSION=$VERSION - docker tag image $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION + podman tag image $IMAGE_ID:$VERSION + podman push $IMAGE_ID:$VERSION diff --git a/Changes.md b/Changes.md index 5070a0e..f46d891 100644 --- a/Changes.md +++ b/Changes.md @@ -1,3 +1,12 @@ +3.0.0ax +======= + +- Dockerfile : Removed `cuda-nsight-compute-11-8.x86_64`, `libcublas-devel-11-8-11.11.3.6-1.x86_64`, `sonar-scanner-4.8.0.2856-linux`, and various intermediate installation files to reduce container size. +- CI : + - Container image is now built with `podman` rather than `docker`. + - Container image is built with `--squash-all` in order to reduce overall container size. + - References to `docker.pkg.github.com` have been changed to `ghcr.io`. + 3.0.0a5 ======= diff --git a/Dockerfile b/Dockerfile index d1a0330..1ff650a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,8 +65,21 @@ RUN yum install -y 'dnf-command(versionlock)' && \ chmod a+x Inkscape-091e20e-x86_64.AppImage && \ ./Inkscape-091e20e-x86_64.AppImage --appimage-extract && \ ln -s /opt/inkscape-1.3.2/squashfs-root/AppRun /usr/local/bin/inkscape && \ + rm -f Inkscape-091e20e-x86_64.AppImage && \ cd - && \ # +# Trim out a few things we don't need. We inherited a lot more than we need from +# `aswf/ci-base`, and we run out of disk space on GitHub Actions if our container +# is too big. A particular offender is CUDA, which comes with all sorts of +# bells and whistles we don't need, and is responsible for at least 5Gb of the +# total image size. + rm -rf /var/opt/sonar-scanner-4.8.0.2856-linux && \ + rm -rf /tmp/downloads && \ + dnf remove -y \ + cuda-nsight-compute-11-8.x86_64 \ + libcublas-devel-11-8-11.11.3.6-1.x86_64 && \ + dnf clean all && \ +# # Now we've installed all our packages, update yum-versionlock for all the # new packages so we can copy the versionlock.list out of the container when we # want to update the build env.