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

ldslaracasts's avatar

First Time Setting Up Docker with Sail

I'm attempting to set up Docker for the first time. I have ensured that my docker client is up to date, as well as running sudo apt-get update on my ubuntu WSL. I keep running into the same error when I attempt to run sail up.

The entire file is quite lengthy, but the first error is in regards to laravel.test and the error is no such service: laravel.test.

The second set of errors are listed below.

#7 138.3 E: Couldn't find any package by glob 'php8.1-cli'
#7 138.3 E: Couldn't find any package by regex 'php8.1-cli'
#7 138.3 E: Unable to locate package php8.1-dev
#7 138.3 E: Couldn't find any package by glob 'php8.1-dev'
#7 138.3 E: Couldn't find any package by regex 'php8.1-dev'
#7 138.3 E: Unable to locate package php8.1-pgsql
#7 138.3 E: Couldn't find any package by glob 'php8.1-pgsql'
#7 138.3 E: Couldn't find any package by regex 'php8.1-pgsql'
#7 138.3 E: Unable to locate package php8.1-sqlite3
#7 138.3 E: Couldn't find any package by glob 'php8.1-sqlite3'
#7 138.3 E: Couldn't find any package by regex 'php8.1-sqlite3'
#7 138.3 E: Unable to locate package php8.1-gd
#7 138.3 E: Couldn't find any package by glob 'php8.1-gd'
#7 138.3 E: Couldn't find any package by regex 'php8.1-gd'
#7 138.3 E: Unable to locate package php8.1-curl
#7 138.3 E: Couldn't find any package by glob 'php8.1-curl'
#7 138.3 E: Couldn't find any package by regex 'php8.1-curl'
#7 138.3 E: Unable to locate package php8.1-imap
#7 138.3 E: Couldn't find any package by glob 'php8.1-imap'
#7 138.3 E: Couldn't find any package by regex 'php8.1-imap'
#7 138.3 E: Unable to locate package php8.1-mysql
#7 138.3 E: Couldn't find any package by glob 'php8.1-mysql'
#7 138.3 E: Couldn't find any package by regex 'php8.1-mysql'
#7 138.3 E: Unable to locate package php8.1-mbstring
#7 138.3 E: Couldn't find any package by glob 'php8.1-mbstring'
#7 138.3 E: Couldn't find any package by regex 'php8.1-mbstring'
#7 138.3 E: Unable to locate package php8.1-xml
#7 138.3 E: Couldn't find any package by glob 'php8.1-xml'
#7 138.3 E: Couldn't find any package by regex 'php8.1-xml'
#7 138.3 E: Unable to locate package php8.1-zip
#7 138.3 E: Couldn't find any package by glob 'php8.1-zip'
#7 138.3 E: Couldn't find any package by regex 'php8.1-zip'
#7 138.3 E: Unable to locate package php8.1-bcmath
#7 138.3 E: Couldn't find any package by glob 'php8.1-bcmath'
#7 138.3 E: Couldn't find any package by regex 'php8.1-bcmath'
#7 138.3 E: Unable to locate package php8.1-soap
#7 138.3 E: Couldn't find any package by glob 'php8.1-soap'
#7 138.3 E: Couldn't find any package by regex 'php8.1-soap'
#7 138.3 E: Unable to locate package php8.1-intl
#7 138.3 E: Couldn't find any package by glob 'php8.1-intl'
#7 138.3 E: Couldn't find any package by regex 'php8.1-intl'
#7 138.3 E: Unable to locate package php8.1-readline
#7 138.3 E: Couldn't find any package by glob 'php8.1-readline'
#7 138.3 E: Couldn't find any package by regex 'php8.1-readline'
#7 138.3 E: Unable to locate package php8.1-ldap
#7 138.3 E: Couldn't find any package by glob 'php8.1-ldap'
#7 138.3 E: Couldn't find any package by regex 'php8.1-ldap'
#7 138.3 E: Unable to locate package php8.1-msgpack
#7 138.3 E: Couldn't find any package by glob 'php8.1-msgpack'
#7 138.3 E: Couldn't find any package by regex 'php8.1-msgpack'
#7 138.3 E: Unable to locate package php8.1-igbinary
#7 138.3 E: Couldn't find any package by glob 'php8.1-igbinary'
#7 138.3 E: Couldn't find any package by regex 'php8.1-igbinary'
#7 138.3 E: Unable to locate package php8.1-redis
#7 138.3 E: Couldn't find any package by glob 'php8.1-redis'
#7 138.3 E: Couldn't find any package by regex 'php8.1-redis'
#7 138.3 E: Unable to locate package php8.1-swoole
#7 138.3 E: Couldn't find any package by glob 'php8.1-swoole'
#7 138.3 E: Couldn't find any package by regex 'php8.1-swoole'
#7 138.3 E: Unable to locate package php8.1-memcached
#7 138.3 E: Couldn't find any package by glob 'php8.1-memcached'
#7 138.3 E: Couldn't find any package by regex 'php8.1-memcached'
#7 138.3 E: Unable to locate package php8.1-pcov
#7 138.3 E: Couldn't find any package by glob 'php8.1-pcov'
#7 138.3 E: Couldn't find any package by regex 'php8.1-pcov'
#7 138.3 E: Unable to locate package php8.1-xdebug
#7 138.3 E: Couldn't find any package by glob 'php8.1-xdebug'
#7 138.3 E: Couldn't find any package by regex 'php8.1-xdebug'```


I'd be grateful for any help regarding this, thanks.
0 likes
14 replies
ldslaracasts's avatar

Here it is

version: '3'
services:
    laravel.test:
        build:
            context: ./vendor/laravel/sail/runtimes/8.1
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        image: sail-8.1/app
        extra_hosts:
            - 'host.docker.internal:host-gateway'
        ports:
            - '${APP_PORT:-80}:80'
        environment:
            WWWUSER: '${WWWUSER}'
            LARAVEL_SAIL: 1
            XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
            XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
        volumes:
            - '.:/var/www/html'
        networks:
            - sail
        depends_on:
            - mysql
            - redis
            - meilisearch
            - selenium
    mysql:
        image: 'mysql/mysql-server:8.0'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ROOT_HOST: "%"
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 1
        volumes:
            - 'sail-mysql:/var/lib/mysql'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
            retries: 3
            timeout: 5s
    redis:
        image: 'redis:alpine'
        ports:
            - '${FORWARD_REDIS_PORT:-6379}:6379'
        volumes:
            - 'sail-redis:/data'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "redis-cli", "ping"]
            retries: 3
            timeout: 5s
    meilisearch:
        image: 'getmeili/meilisearch:latest'
        ports:
            - '${FORWARD_MEILISEARCH_PORT:-7700}:7700'
        volumes:
            - 'sail-meilisearch:/data.ms'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "wget", "--no-verbose", "--spider",  "http://localhost:7700/health"]
            retries: 3
            timeout: 5s
    mailhog:
        image: 'mailhog/mailhog:latest'
        ports:
            - '${FORWARD_MAILHOG_PORT:-1025}:1025'
            - '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025'
        networks:
            - sail
    selenium:
        image: 'selenium/standalone-chrome'
        volumes:
            - '/dev/shm:/dev/shm'
        networks:
            - sail
networks:
    sail:
        driver: bridge
volumes:
    sail-mysql:
        driver: local
    sail-redis:
        driver: local
    sail-meilisearch:
        driver: local
srssaulo's avatar

i have the same problem . i tried apt clean in dockerfile Runtime 8.1 into vendor, but the fail persists build, build --no-cache, rm images, nothings was successfull. here my docker-compose.yml

version: '3'

services:
    laravel.test:
        build:
            context: ./vendor/laravel/sail/runtimes/8.1
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        image: sail-8.1/app
        extra_hosts:
            - 'host.docker.internal:host-gateway'
        ports:
            - '8080:80'
        environment:
            WWWUSER: '${WWWUSER}'
            LARAVEL_SAIL: 1
            XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
            XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
        volumes:
            - '.:/var/www/html'
        networks:
            - sail
        depends_on:
            - mysql
    mysql:
        image: 'mysql/mysql-server:8.0'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ROOT_HOST: "%"
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 1
        volumes:
            - 'sail-mysql:/var/lib/mysql'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
            retries: 3
            timeout: 5s
networks:
    sail:
        driver: bridge
volumes:
    sail-mysql:
        driver: local
TaganTrader's avatar

Now I solved this problem. You must update sail. composer update laravel/sail. If composer throw the error, you must solve your error and update anyway! Searching for other solutions will lead you to a dead end.

1 like
monsi's avatar

i have the same errors using the stock docker file. I get the errors with all three type of context (7.4 8.0 and 8.1) Updating sail didn't solve anything unfortunately.

I have also checked the link shaungbhone provided, but it didn't help

office@pixelsolutions.ro's avatar

Hei!

Update your sail version to the latest(1.13.3) This worked as a charm for me.

monsi's avatar

try this:

  • update sail.to the latest version
  • be sure to update also the Docker file from the /vendor/laravel/sail/runtimes folder to the /docker folder

that solved the problem for me

2 likes
Krystian Laubach's avatar

Updating Sail to the latest 1.13.7 didn’t help. Still cannot use Dockerfile 8.1

'Unable to locate package php8.1-cli'

All work fine when I use Dockerfile 8.0. Looks like missing php8.1 packages in the source

&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu impish main" > /etc/apt/sources.list.d/ppa_ondrej_php.list 
Krystian Laubach's avatar

I have resolved the issue: went for a walk with the dog :)

I can confirm that updating Laravel Sail to the newest version 1.13.7 fixed the issue. I've been still using Dockerfile that I've published to docker folder. So, I have changed context in my docker-compose.yml to

context: ./vendor/laravel/sail/runtimes/8.1

and now all works fine. The app container has been successfully built!

Please or to participate in this conversation.