Files
renovate/.github/actions/setup-docker/action.yml
renovate[bot] c5a2722b20 chore(deps): update jlumbroso/free-disk-space action to v1.3.2 (main) (#46283)
chore(deps): update jlumbroso/free-disk-space action to v1.3.2

| datasource  | package                   | from   | to     |
| ----------- | ------------------------- | ------ | ------ |
| github-tags | jlumbroso/free-disk-space | v1.3.1 | v1.3.2 |

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-09-17 05:24:20 +00:00

68 lines
2.2 KiB
YAML

name: 'Setup Docker'
description: 'Prepare Docker for multi-platform image builds, freeing disk space on low-capacity runners'
runs:
using: 'composite'
steps:
- run: df -h
shell: bash
- name: Check for old vm with low disk space
id: check
shell: bash
run: |
if [[ -e /dev/sdb1 ]]; then
echo "::warning::We're on old vm, running cleanup"
echo "do-cleanup=true" >> "$GITHUB_OUTPUT"
else
echo "::notice::We're on new vm, no cleanup required"
echo "do-cleanup=false" >> "$GITHUB_OUTPUT"
fi
# Some runner vm's are smaller than others for unknown reasons
# https://github.com/orgs/community/discussions/199328
# To avoid disk space issues when performing a multi-platform docker build, we can clear up some disk space ahead of time
- name: Free Disk Space
if: ${{ steps.check.outputs.do-cleanup == 'true' }}
uses: jlumbroso/free-disk-space@3f13feab2962a87273d379ebc36ea159527e6cc9 # v1.3.2
with:
# we're likely already using some of the globally installed tools
tool-cache: false
# there are no images by default
docker-images: false
# but we're definitely not using these
android: true
dotnet: true
haskell: true
# there is no swap storage anymore
swap-storage: false
large-packages: true # breaks docker cross platform support
- run: df -h
if: ${{ steps.check.outputs.do-cleanup == 'true' }}
shell: bash
- name: Set up containerd image store
shell: bash
run: |
if [ ! -f /etc/docker/daemon.json ]; then
echo "{}" | sudo tee /etc/docker/daemon.json
fi
cat /etc/docker/daemon.json | jq '. | .+{"features": {"containerd-snapshotter": true},"data-root": "/mnt/docker"}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
- name: Check docker service
shell: bash
run: |
systemctl status docker
- name: Check docker info
shell: bash
run: |
docker info
# allow build cross arch images
- uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0