Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sail build --no-cache fails when rebuilding containers #440

Closed
jorgenb opened this issue Jun 24, 2022 · 5 comments · Fixed by #441
Closed

sail build --no-cache fails when rebuilding containers #440

jorgenb opened this issue Jun 24, 2022 · 5 comments · Fixed by #441

Comments

@jorgenb
Copy link

jorgenb commented Jun 24, 2022

  • Sail Version: "laravel/sail": "^1.0.1",
  • Laravel Version: "laravel/framework": "^9.11",
  • PHP Version: 7.4
  • OS: macOS (arm)

Description:

sail build --no-cache fails when rebuilding containers.

Steps To Reproduce:

curl -s "https://laravel.build/example-app?with=mysql,redis" | bash
cd example-app

Set 7.4 in the docker-compose.yml file:

# For more information: https://laravel.com/docs/sail
version: '3'
services:
    laravel.test:
        build:
            context: ./vendor/laravel/sail/runtimes/7.4
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        image: sail-7.4/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
    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'
            - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
        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
networks:
    sail:
        driver: bridge
volumes:
    sail-mysql:
        driver: local
    sail-redis:
        driver: local

Run sail build --no-cache:

<snip>
#0 60.35 Get:1 http://apt.postgresql.org/pub/repos/apt impish-pgdg InRelease [19.0 kB]
#0 60.36 Hit:2 https://deb.nodesource.com/node_16.x impish InRelease
#0 60.36 Get:3 https://dl.yarnpkg.com/debian stable InRelease [17.1 kB]
#0 60.37 Hit:4 http://ports.ubuntu.com/ubuntu-ports impish InRelease
#0 60.41 Hit:5 http://ports.ubuntu.com/ubuntu-ports impish-updates InRelease
#0 60.45 Get:6 https://dl.yarnpkg.com/debian stable/main arm64 Packages [11.1 kB]
#0 60.46 Hit:7 http://ports.ubuntu.com/ubuntu-ports impish-backports InRelease
#0 60.47 Hit:8 https://ppa.launchpadcontent.net/ondrej/php/ubuntu impish InRelease
#0 60.49 Get:9 https://dl.yarnpkg.com/debian stable/main all Packages [11.1 kB]
#0 60.50 Hit:10 http://ports.ubuntu.com/ubuntu-ports impish-security InRelease
#0 60.74 Fetched 58.2 kB in 0s (124 kB/s)
#0 60.74 Reading package lists...
#0 61.11 Reading package lists...
#0 61.44 Building dependency tree...
#0 61.53 Reading state information...
#0 61.61 The following NEW packages will be installed:
#0 61.61   yarn
#0 61.71 0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
#0 61.71 Need to get 893 kB of archives.
#0 61.71 After this operation, 5415 kB of additional disk space will be used.
#0 61.71 Get:1 https://dl.yarnpkg.com/debian stable/main arm64 yarn all 1.22.19-1 [893 kB]
#0 61.82 debconf: delaying package configuration, since apt-utils is not installed
#0 61.85 Fetched 893 kB in 0s (6527 kB/s)
#0 61.87 Selecting previously unselected package yarn.
(Reading database ... 25034 files and directories currently installed.)
#0 61.88 Preparing to unpack .../yarn_1.22.19-1_all.deb ...
#0 61.88 Unpacking yarn (1.22.19-1) ...
#0 61.96 Setting up yarn (1.22.19-1) ...
#0 62.00 Reading package lists...
#0 62.34 Building dependency tree...
#0 62.42 Reading state information...
#0 62.49 The following additional packages will be installed:
#0 62.49   mysql-client-8.0 mysql-client-core-8.0 mysql-common
#0 62.51 The following NEW packages will be installed:
#0 62.51   mysql-client mysql-client-8.0 mysql-client-core-8.0 mysql-common
#0 62.61 0 upgraded, 4 newly installed, 0 to remove and 6 not upgraded.
#0 62.61 Need to get 2833 kB of archives.
#0 62.61 After this operation, 61.3 MB of additional disk space will be used.
#0 62.61 Get:1 http://ports.ubuntu.com/ubuntu-ports impish-updates/main arm64 mysql-client-core-8.0 arm64 8.0.29-0ubuntu0.21.10.2 [2793 kB]
#0 63.00 Get:2 http://ports.ubuntu.com/ubuntu-ports impish/main arm64 mysql-common all 5.8+1.0.5ubuntu2 [7496 B]
#0 63.00 Get:3 http://ports.ubuntu.com/ubuntu-ports impish-updates/main arm64 mysql-client-8.0 arm64 8.0.29-0ubuntu0.21.10.2 [22.7 kB]
#0 63.00 Get:4 http://ports.ubuntu.com/ubuntu-ports impish-updates/main arm64 mysql-client all 8.0.29-0ubuntu0.21.10.2 [9432 B]
#0 63.08 debconf: delaying package configuration, since apt-utils is not installed
#0 63.10 Fetched 2833 kB in 0s (5808 kB/s)
#0 63.11 Selecting previously unselected package mysql-client-core-8.0.
(Reading database ... 25053 files and directories currently installed.)
#0 63.12 Preparing to unpack .../mysql-client-core-8.0_8.0.29-0ubuntu0.21.10.2_arm64.deb ...
#0 63.12 Unpacking mysql-client-core-8.0 (8.0.29-0ubuntu0.21.10.2) ...
#0 63.32 Selecting previously unselected package mysql-common.
#0 63.33 Preparing to unpack .../mysql-common_5.8+1.0.5ubuntu2_all.deb ...
#0 63.34 Unpacking mysql-common (5.8+1.0.5ubuntu2) ...
#0 63.35 Selecting previously unselected package mysql-client-8.0.
#0 63.36 Preparing to unpack .../mysql-client-8.0_8.0.29-0ubuntu0.21.10.2_arm64.deb ...
#0 63.36 Unpacking mysql-client-8.0 (8.0.29-0ubuntu0.21.10.2) ...
#0 63.37 Selecting previously unselected package mysql-client.
#0 63.38 Preparing to unpack .../mysql-client_8.0.29-0ubuntu0.21.10.2_all.deb ...
#0 63.38 Unpacking mysql-client (8.0.29-0ubuntu0.21.10.2) ...
#0 63.46 Setting up mysql-common (5.8+1.0.5ubuntu2) ...
#0 63.48 update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
#0 63.48 Setting up mysql-client-core-8.0 (8.0.29-0ubuntu0.21.10.2) ...
#0 63.49 Setting up mysql-client-8.0 (8.0.29-0ubuntu0.21.10.2) ...
#0 63.50 Setting up mysql-client (8.0.29-0ubuntu0.21.10.2) ...
#0 63.50 Processing triggers for man-db (2.9.4-2) ...
#0 63.55 Reading package lists...
#0 63.90 Building dependency tree...
#0 63.98 Reading state information...
#0 63.99 E: Unable to locate package postgresql-client-14
------
failed to solve: 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     && echo "keyserver hkp://keyserver.ubuntu.com:80" >> ~/.gnupg/dirmngr.conf     && gpg --recv-key 0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c     && gpg --export 0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c > /usr/share/keyrings/ppa_ondrej_php.gpg     && echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu impish main" > /etc/apt/sources.list.d/ppa_ondrej_php.list     && apt-get update     && apt-get install -y php7.4-cli php7.4-dev        php7.4-pgsql php7.4-sqlite3 php7.4-gd        php7.4-curl php7.4-memcached        php7.4-imap php7.4-mysql php7.4-mbstring        php7.4-xml php7.4-zip php7.4-bcmath php7.4-soap        php7.4-intl php7.4-readline php7.4-pcov        php7.4-msgpack php7.4-igbinary php7.4-ldap        php7.4-redis php7.4-xdebug     && php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer     && curl -sLS 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 | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null     && echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list     && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/pgdg.gpg >/dev/null     && echo "deb [signed-by=/usr/share/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt impish-pgdg main" > /etc/apt/sources.list.d/pgdg.list     && apt-get update     && apt-get install -y yarn     && apt-get install -y mysql-client     && apt-get install -y postgresql-client-$POSTGRES_VERSION     && apt-get -y autoremove     && apt-get clean     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 100
@driesvints
Copy link
Member

You're using a very outdated version of Sail. Try upgrading and try again.

@jorgenb
Copy link
Author

jorgenb commented Jun 24, 2022

@driesvints 1.0.1 is what get's pulled in when running curl -s "https://laravel.build/example-app?with=mysql,redis" | bash

@jorgenb
Copy link
Author

jorgenb commented Jun 24, 2022

Error is still present after upgrading to latest larval/sail and docker-compose.yml file.

@driesvints
Copy link
Member

Not sure if it's related but you're trying to combine Laravel 9 and PHP 7.4 which Laravel 9 doesn't supports.

@driesvints
Copy link
Member

Probably not related ^

I can confirm it works if I downgrade postgres client to v13 on 7.4 and 8.0 runtimes. Here's a PR: #441

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants