Skip to content

Instantly share code, notes, and snippets.

@dieter-medium
Created May 12, 2025 13:06
Show Gist options
  • Save dieter-medium/83ce24309e4945a28cd7daba7ee154a7 to your computer and use it in GitHub Desktop.
Save dieter-medium/83ce24309e4945a28cd7daba7ee154a7 to your computer and use it in GitHub Desktop.
Quick Docker commands to troubleshoot networking in GitHub Actions runners—inject host.docker.internal and test reachability, including auto-detecting private IP.
check-env:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Check env
run: |
env
docker info
docker run --rm --add-host "host.docker.internal:host-gateway" alpine:latest cat /etc/hosts
docker run --rm --add-host "host.docker.internal:host-gateway" alpine:latest ping -c 1 host.docker.internal
docker run --rm --add-host "host.docker.internal:host-gateway" alpine:latest ping -c 1 $(ruby -rsocket -e 'puts Socket.ip_address_list.detect(&:ipv4_private?).ip_address')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment