Created
May 12, 2025 13:06
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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