I recall struggling with this myself, and the issue was that I wasn't using the newest version of docker. I was using the version that came with Linux mint/Ubuntu. After installing the ppa and reinstalling docker, it started working
Sail, Ubuntu & spaite/ray
Having trouble getting Spatie's Ray working after fresh install via https://laravel.build. My host machine is Linux Mint / Ubuntu.
Anyone know what I'm doing wrong?
(Just sticking with the framework agnostic install for now (ultimate goal is to get this working in another project, but wanted to use Sail's web host container to eliminate that project's very custom container as a cause))
docker-compose.yml:
laravel.test:
build:
context: ./vendor/laravel/sail/runtimes/8.1
dockerfile: Dockerfile
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT:-80}:80'
volumes:
- '.:/var/www/html'
networks:
- sail
ray.php:
return [
'enable' => true,
'host' => 'host.docker.internal',
'port' => 23517,
'remote_path' => '/var/www/html',
'local_path' => '/home/itsme/Code/example-app',
'always_send_raw_values' => false,
];
Host machine /etc/hosts:
127.0.0.1 host.docker.internal
/etc/hosts within laravel.test container:
172.17.0.1 host.docker.internal
Ray is listening on my machine:
$ sudo netstat -tupl | grep 23517
tcp6 0 0 [::]:23517 [::]:* LISTEN 342313/ray
From host machine, can get a response from Ray:
$ curl -I http://host.docker.internal:23517/_availability_check
HTTP/1.1 404 Not Found
X-Powered-By: Express
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'none'
X-Content-Type-Options: nosniff
Content-Type: text/html; charset=utf-8
Content-Length: 159
From within laravel.test container, cannot talk to Ray:
$ curl -I http://host.docker.internal:23517/_availability_check
curl: (28) Failed to connect to host.docker.internal port 23517: Connection timed out
Please or to participate in this conversation.