Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SERVANT14's avatar

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
0 likes
2 replies
Sinnbeck's avatar

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

SERVANT14's avatar

Okay! I just did a quick check. It looks like I am on the latest version. I will try to reinstall at some point and see if that help helps :).

~ » docker version
Client: Docker Engine - Community
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:45:33 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.12
  Git commit:       459d0df
  Built:            Mon Dec 13 11:43:42 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

~ » docker-compose version                            
docker-compose version 1.29.1, build c34c88b2
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

Please or to participate in this conversation.