Skip to content

Commit

Permalink
CI: Use a non-rate-limiting docker.io mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
snazy committed Nov 21, 2024
1 parent 2264d35 commit d61980c
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion .github/actions/setup-runner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ runs:
- name: Memory report
shell: bash
run: |
echo "::group::Memory and disk"
echo "Memory and swap:"
free
echo
Expand All @@ -19,6 +20,7 @@ runs:
echo "Available storage:"
df -h
echo
echo "::endgroup::"
- name: Add 8G more swap
if: ${{ inputs.more-memory != 'false' }}
shell: bash
Expand All @@ -31,6 +33,7 @@ runs:
if: ${{ inputs.more-memory != 'false' }}
shell: bash
run: |
echo "::group::Memory and disk after swap enabled"
echo "Memory report after adding more swap:"
free
echo
Expand All @@ -39,7 +42,47 @@ runs:
echo "Available storage:"
df -h
echo
echo "::endgroup::"
- name: Update /etc/hosts
shell: bash
run: echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
run: |
echo "::group::Contents of /etc/hosts"
echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
echo "::endgroup::"
- name: Setup docker.io mirror
shell: bash
run: |
echo "::group::cat /etc/docker/daemon.json"
sudo cat /etc/docker/daemon.json || true
echo "::endgroup::"
echo "::group::ls /etc/docker/"
sudo ls -al /etc/docker/
sudo find /etc/docker/
echo "::endgroup::"
echo "::group::ls /etc/containers/"
sudo ls -al /etc/containers/
sudo find /etc/containers/
echo "::endgroup::"
cat > docker-io-mirror.conf <<!
[[registry]]
# In Nov. 2020, Docker rate-limits image pulling. To avoid hitting these
# limits while testing, always use the google mirror for qualified and
# unqualified `docker.io` images.
# Ref: https://cloud.google.com/container-registry/docs/pulling-cached-images
prefix="docker.io"
location="mirror.gcr.io"
!
sudo mv docker-io-mirror.conf /etc/containers/registries.conf.d/
echo "::group::Added docker.io mirror"
cat /etc/containers/registries.conf.d/docker-io-mirror.conf
echo "::endgroup::"
echo "::group::Restarting Docker"
sudo service docker restart
echo "::endgroup::"

0 comments on commit d61980c

Please sign in to comment.