gdk measure doesn't work on Linux
Overview
While trying to run gdk measure
on a Linux box, it fails with:
[2021-08-13 11:50:45] INFO: URL failed to load, trying 5 more time(s): Could not load http://gdk.test:3000/explore is the web page down?
It seems that the hostname cannot be read in the sitespeed container.
I have set up a local network according to https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/local_network.md, and I can reach http://gdk.test:3000/explore
just fine.
This was first reported by @thomasrandolph in Slack https://gitlab.slack.com/archives/C2Z9A056E/p1628793146075200 (internal).
Steps to replicate (optional)
On a Linux box:
- Set up a local network
- Run
gdk measure /explore
Proposal (optional)
I see that we substitute the loopback hostnames in https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/d38d63c910a6b10b9a78ca4ce49b257fc9b60757/lib/gdk/command/measure_url.rb#L37-38 with host.docker.internal
. Is that a macOS-specific hostname?
Maybe this is the place to make a change and make this work?
Environment (optional)
- Operating system: Linux
- The contents of your
gdk.yml
- Ruby version:
<!-- output of
ruby --version-->
- GDK version: latest