1

I am getting the following errors after doing docker-compose up -d:

exit code: 100 Service 'laravel.test' failed to build : Build failed

I am running this from a Bash terminal in Windows 10. It's for a Laravel PHP application.

Here is my docker-compose.yml file:

# For more information: https://laravel.com/docs/sail
version: '3'
services:
    laravel.test:
        build:
            context: ./vendor/laravel/sail/runtimes/8.0
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        image: sail-8.0/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:
            - pgsql
            - redis
    pgsql:
        image: 'postgres:13'
        ports:
            - '${FORWARD_DB_PORT:-5432}:5432'
        environment:
            PGPASSWORD: '${DB_PASSWORD:-secret}'
            POSTGRES_DB: '${DB_DATABASE}'
            POSTGRES_USER: '${DB_USERNAME}'
            POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
        volumes:
            - 'sailpgsql:/var/lib/postgresql/data'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "pg_isready", "-q", "-d", "${DB_DATABASE}", "-U", "${DB_USERNAME}"]
            retries: 3
            timeout: 5s
    redis:
        image: 'redis:alpine'
        ports:
            - '${FORWARD_REDIS_PORT:-6379}:6379'
        volumes:
            - 'sailredis:/data'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "redis-cli", "ping"]
            retries: 3
            timeout: 5s
    mailhog:
        image: 'mailhog/mailhog:latest'
        ports:
            - '${FORWARD_MAILHOG_PORT:-1025}:1025'
            - '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025'
        networks:
            - sail
networks:
    sail:
        driver: bridge
volumes:
    sailpgsql:
        driver: local
    sailredis:
        driver: local

Full error log:

$ docker-compose down && docker-compose up -d
Removing network mccoy_sail
Creating network "mccoy_sail" with driver "bridge"
Building laravel.test
#1 [internal] load build definition from Dockerfile
#1 sha256:bb2b701f7101439e80d79e3c322f78f0280baef84167ba1981c4a6f964206e09
#1 transferring dockerfile: 32B done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 sha256:b9305cedb52486a8251e0de7a8ec22c63301b44f3eec36cb95cfe17d0f576101
#2 transferring context: 2B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/ubuntu:21.04
#3 sha256:77f2f3e1058c306cdbda7916b1ae303fdb26fc49e385534ae8aa5e1333051bee
#3 DONE 1.7s

#4 [ 1/11] FROM docker.io/library/ubuntu:21.04@sha256:ba394fabd516b39ccf8597ec656a9ddd7d0a2688ed8cb373ca7ac9b6fe67848f
#4 sha256:60b906028ef2f1d7caed619a77694d20e602151bcb693ec66bf809647a067683
#4 DONE 0.0s

#5 [ 2/11] WORKDIR /var/www/html
#5 sha256:064f64b9c63b3d1af598f8543c3b31a5901c756f9a95db9cd9aeaabb21d5327e
#5 CACHED

#6 [ 3/11] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone
#6 sha256:9c8400b64ec11dd0fd35b80486982c4786ae010699f5b92c04054df3a6f9ad55
#6 CACHED

#11 [internal] load build context
#11 sha256:ca8e88d7d9a618d5cfd212f091947fa55c444b4d2b1010519067a572ead8e0ae
#11 transferring context: 99B done
#11 DONE 0.1s

#7 [ 4/11] RUN apt-get update     && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2     && mkdir -p ~/.gnupg     && chmod 600 ~/.gnupg     && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C     && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu hirsute main" > 

// a lot of stuff omitted for presentational reasons on SO.

#7 56.77 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
#7 56.79 Executing: /tmp/apt-key-gpghome.3M6BNcO2xW/gpg.1.sh --homedir /root/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C
#7 56.89 gpg: key 00A6F0A3C300EE8C: public key "Launchpad Stable" imported
#7 56.89 gpg: Total number processed: 1
#7 56.89 gpg:               imported: 1
#7 57.25 Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu hirsute InRelease [23.9 kB]
#7 57.26 Hit:2 http://security.ubuntu.com/ubuntu hirsute-security InRelease
#7 57.26 Hit:3 http://archive.ubuntu.com/ubuntu hirsute InRelease
#7 57.31 Hit:4 http://archive.ubuntu.com/ubuntu hirsute-updates InRelease
#7 57.34 Hit:5 http://archive.ubuntu.com/ubuntu hirsute-backports InRelease
#7 57.56 Fetched 23.9 kB in 1s (42.3 kB/s)
#7 57.56 Reading package lists...
#7 58.11 Reading package lists...
#7 58.62 Building dependency tree...
#7 58.74 Reading state information...
#7 59.44 E: Unable to locate package php8.0-cli
#7 59.44 E: Couldn't find any package by glob 'php8.0-cli'
#7 59.44 E: Couldn't find any package by regex 'php8.0-cli'
#7 59.44 E: Unable to locate package php8.0-dev
#7 59.44 E: Couldn't find any package by glob 'php8.0-dev'
#7 59.44 E: Couldn't find any package by regex 'php8.0-dev'
#7 59.44 E: Unable to locate package php8.0-pgsql
#7 59.44 E: Couldn't find any package by glob 'php8.0-pgsql'
#7 59.44 E: Couldn't find any package by regex 'php8.0-pgsql'
#7 59.44 E: Unable to locate package php8.0-sqlite3
#7 59.44 E: Couldn't find any package by glob 'php8.0-sqlite3'
#7 59.44 E: Couldn't find any package by regex 'php8.0-sqlite3'
#7 59.44 E: Unable to locate package php8.0-gd
#7 59.44 E: Couldn't find any package by glob 'php8.0-gd'
#7 59.44 E: Couldn't find any package by regex 'php8.0-gd'
#7 59.44 E: Unable to locate package php8.0-curl
#7 59.44 E: Couldn't find any package by glob 'php8.0-curl'
#7 59.44 E: Couldn't find any package by regex 'php8.0-curl'
#7 59.44 E: Unable to locate package php8.0-memcached
#7 59.44 E: Couldn't find any package by glob 'php8.0-memcached'
#7 59.44 E: Couldn't find any package by regex 'php8.0-memcached'
#7 59.44 E: Unable to locate package php8.0-imap
#7 59.44 E: Couldn't find any package by glob 'php8.0-imap'
#7 59.44 E: Couldn't find any package by regex 'php8.0-imap'
#7 59.44 E: Unable to locate package php8.0-mysql
#7 59.44 E: Couldn't find any package by glob 'php8.0-mysql'
#7 59.44 E: Couldn't find any package by regex 'php8.0-mysql'
#7 59.44 E: Unable to locate package php8.0-mbstring
#7 59.44 E: Couldn't find any package by glob 'php8.0-mbstring'
#7 59.44 E: Couldn't find any package by regex 'php8.0-mbstring'
#7 59.44 E: Unable to locate package php8.0-xml
#7 59.44 E: Couldn't find any package by glob 'php8.0-xml'
#7 59.44 E: Couldn't find any package by regex 'php8.0-xml'
#7 59.44 E: Unable to locate package php8.0-zip
#7 59.44 E: Couldn't find any package by glob 'php8.0-zip'
#7 59.44 E: Couldn't find any package by regex 'php8.0-zip'
#7 59.44 E: Unable to locate package php8.0-bcmath
#7 59.44 E: Couldn't find any package by glob 'php8.0-bcmath'
#7 59.44 E: Couldn't find any package by regex 'php8.0-bcmath'
#7 59.44 E: Unable to locate package php8.0-soap
#7 59.44 E: Couldn't find any package by glob 'php8.0-soap'
#7 59.44 E: Couldn't find any package by regex 'php8.0-soap'
#7 59.44 E: Unable to locate package php8.0-intl
#7 59.44 E: Couldn't find any package by glob 'php8.0-intl'
#7 59.44 E: Couldn't find any package by regex 'php8.0-intl'
#7 59.44 E: Unable to locate package php8.0-readline
#7 59.44 E: Couldn't find any package by glob 'php8.0-readline'
#7 59.44 E: Couldn't find any package by regex 'php8.0-readline'
#7 59.44 E: Unable to locate package php8.0-pcov
#7 59.44 E: Couldn't find any package by glob 'php8.0-pcov'
#7 59.44 E: Couldn't find any package by regex 'php8.0-pcov'
#7 59.44 E: Unable to locate package php8.0-msgpack
#7 59.44 E: Couldn't find any package by glob 'php8.0-msgpack'
#7 59.44 E: Couldn't find any package by regex 'php8.0-msgpack'
#7 59.44 E: Unable to locate package php8.0-igbinary
#7 59.44 E: Couldn't find any package by glob 'php8.0-igbinary'
#7 59.44 E: Couldn't find any package by regex 'php8.0-igbinary'
#7 59.44 E: Unable to locate package php8.0-ldap
#7 59.44 E: Couldn't find any package by glob 'php8.0-ldap'
#7 59.44 E: Couldn't find any package by regex 'php8.0-ldap'
#7 59.44 E: Unable to locate package php8.0-redis
#7 59.44 E: Couldn't find any package by glob 'php8.0-redis'
#7 59.44 E: Couldn't find any package by regex 'php8.0-redis'
#7 59.44 E: Unable to locate package php8.0-swoole
#7 59.44 E: Couldn't find any package by glob 'php8.0-swoole'
#7 59.44 E: Couldn't find any package by regex 'php8.0-swoole'
#7 59.44 E: Unable to locate package php8.0-xdebug
#7 59.44 E: Couldn't find any package by glob 'php8.0-xdebug'
#7 59.44 E: Couldn't find any package by regex 'php8.0-xdebug'
#7 ERROR: executor failed running [/bin/sh -c apt-get update     && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2     && mkdir -p ~/.gnupg     && chmod 600 ~/.gnupg     && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C     && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu hirsute main" > /etc/apt/sources.list.d/ppa_ondrej_php.list     && apt-get update     && apt-get install -y php8.0-cli php8.0-dev        php8.0-pgsql php8.0-sqlite3 php8.0-gd        php8.0-curl php8.0-memcached        php8.0-imap php8.0-mysql php8.0-mbstring        php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap        php8.0-intl php8.0-readline php8.0-pcov        php8.0-msgpack php8.0-igbinary php8.0-ldap        php8.0-redis php8.0-swoole php8.0-xdebug     && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer     && curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -     && apt-get install -y nodejs     && npm install -g npm     && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -     && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list     && apt-get update     && apt-get install -y yarn     && apt-get install -y mysql-client     && apt-get install -y postgresql-client     && apt-get -y autoremove     && apt-get clean     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 100
------
 > [ 4/11] RUN apt-get update     && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2     && mkdir -p ~/.gnupg     && chmod 600 ~/.gnupg     && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C     && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu hirsute main" > /etc/apt/sources.list.d/ppa_ondrej_php.list     && apt-get update     && apt-get install -y php8.0-cli php8.0-dev        php8.0-pgsql php8.0-sqlite3 php8.0-gd        php8.0-curl php8.0-memcached        php8.0-imap php8.0-mysql php8.0-mbstring        php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap        php8.0-intl php8.0-readline php8.0-pcov        php8.0-msgpack php8.0-igbinary php8.0-ldap        php8.0-redis php8.0-swoole php8.0-xdebug     && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer     && curl -sL https://deb.nodesource.com/setup_16.x | bash -     && apt-get install -y nodejs     && npm install -g npm     && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -     && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list     && apt-get update     && apt-get install -y yarn     && apt-get install -y mysql-client     && apt-get install -y postgresql-client     && apt-get -y autoremove     && apt-get clean     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*:
------
executor failed running [/bin/sh -c apt-get update     && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2     && mkdir -p ~/.gnupg     && chmod 600 ~/.gnupg     && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C     && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu hirsute main" > /etc/apt/sources.list.d/ppa_ondrej_php.list     && apt-get update     && apt-get install -y php8.0-cli php8.0-dev        php8.0-pgsql php8.0-sqlite3 php8.0-gd        php8.0-curl php8.0-memcached        php8.0-imap php8.0-mysql php8.0-mbstring        php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap        php8.0-intl php8.0-readline php8.0-pcov        php8.0-msgpack php8.0-igbinary php8.0-ldap        php8.0-redis php8.0-swoole php8.0-xdebug     && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer     && curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -     && apt-get install -y nodejs     && npm install -g npm     && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -     && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list     && apt-get update     && apt-get install -y yarn     && apt-get install -y mysql-client     && apt-get install -y postgresql-client     && apt-get -y autoremove     && apt-get clean     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 100
Service 'laravel.test' failed to build : Build failed

1 Answer 1

6

Turns out I had to update the Laravel Sail version by doing a composer update outside of the docker container. I have WAMP installed locally so I was able to run the composer update. Just ensure your PHP CLI version matches the one required in the Docker container.

Sign up to request clarification or add additional context in comments.

1 Comment

Works! Was stuck on this for an hour..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.