sail: Ubuntu container doesn't build.

  • Sail Version: #.#.# 1.12.7
  • Laravel Version: #.#.# v8.73.2
  • PHP Version: #.#.# 8.0.13
  • OS: Windows / Linux / macOS #.#.# Ubuntu 20.04

Description:

Can’t run Sail. Building the ubuntu container fails with this error:

W: GPG error: http://archive.ubuntu.com/ubuntu hirsute InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://archive.ubuntu.com/ubuntu hirsute InRelease' is not signed.
W: GPG error: http://archive.ubuntu.com/ubuntu hirsute-updates InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://archive.ubuntu.com/ubuntu hirsute-updates InRelease' is not signed.
W: GPG error: http://archive.ubuntu.com/ubuntu hirsute-backports InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://archive.ubuntu.com/ubuntu hirsute-backports InRelease' is not signed.
W: GPG error: http://security.ubuntu.com/ubuntu hirsute-security InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://security.ubuntu.com/ubuntu hirsute-security InRelease' is not signed.

Full log:

Step 9/18 : 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.1-cli php8.1-dev        php8.1-pgsql php8.1-sqlite3 php8.1-gd        php8.1-curl        php8.1-imap php8.1-mysql php8.1-mbstring        php8.1-xml php8.1-zip php8.1-bcmath php8.1-soap        php8.1-intl php8.1-readline        php8.1-ldap        php8.1-msgpack php8.1-igbinary php8.1-redis php8.1-swoole        php8.1-memcached php8.1-pcov php8.1-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/*
 ---> Running in 39da3a725f7b
Get:1 http://archive.ubuntu.com/ubuntu hirsute InRelease [269 kB]
Get:2 http://security.ubuntu.com/ubuntu hirsute-security InRelease [110 kB]
Get:3 http://archive.ubuntu.com/ubuntu hirsute-updates InRelease [115 kB]
Err:1 http://archive.ubuntu.com/ubuntu hirsute InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Get:4 http://archive.ubuntu.com/ubuntu hirsute-backports InRelease [101 kB]
Err:3 http://archive.ubuntu.com/ubuntu hirsute-updates InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:4 http://archive.ubuntu.com/ubuntu hirsute-backports InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:2 http://security.ubuntu.com/ubuntu hirsute-security InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Reading package lists...
W: GPG error: http://archive.ubuntu.com/ubuntu hirsute InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://archive.ubuntu.com/ubuntu hirsute InRelease' is not signed.
W: GPG error: http://archive.ubuntu.com/ubuntu hirsute-updates InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://archive.ubuntu.com/ubuntu hirsute-updates InRelease' is not signed.
W: GPG error: http://archive.ubuntu.com/ubuntu hirsute-backports InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://archive.ubuntu.com/ubuntu hirsute-backports InRelease' is not signed.
W: GPG error: http://security.ubuntu.com/ubuntu hirsute-security InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://security.ubuntu.com/ubuntu hirsute-security InRelease' is not signed.
ERROR: Service 'laravel.test' failed to build : The command '/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.1-cli php8.1-dev        php8.1-pgsql php8.1-sqlite3 php8.1-gd        php8.1-curl        php8.1-imap php8.1-mysql php8.1-mbstring        php8.1-xml php8.1-zip php8.1-bcmath php8.1-soap        php8.1-intl php8.1-readline        php8.1-ldap        php8.1-msgpack php8.1-igbinary php8.1-redis php8.1-swoole        php8.1-memcached php8.1-pcov php8.1-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/*' returned a non-zero code: 100

Steps To Reproduce:

laravel new app composer require laravel/sail --dev php artisan sail:install (select pgsql) ./vendor/bin/sail up

done

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 46 (8 by maintainers)

Most upvoted comments

I think the solution here is pretty clear:

a) Update Composer; b) If you have copied the Dockerfile then it needs to be updated

I believe this issue should be locked now.

Updating Sail via composer update fixed the issue for me

Update

Turning off Private Relay in iCloud settings solved the issue for me!


Same issue here.

Everything was working fine with 8.0 but I get the same error now that i’m trying 8.1

docker-compose v2.1.1 laravel/framework v8.73.2 laravel/sail v1.12.8

docker-compose.yml

# For more information: https://laravel.com/docs/sail
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
  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:
      - "sailmysql:/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:
      - "sailredis:/data"
    networks:
      - sail
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      retries: 3
      timeout: 5s
  meilisearch:
    image: "getmeili/meilisearch:latest"
    platform: linux/x86_64
    ports:
      - "${FORWARD_MEILISEARCH_PORT:-7700}:7700"
    volumes:
      - "sailmeilisearch:/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
networks:
  sail:
    driver: bridge
volumes:
  sailmysql:
    driver: local
  sailredis:
    driver: local
  sailmeilisearch:
    driver: local

Error log

=> [ 3/11] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone                                                   0.2s
 => ERROR [ 4/11] RUN apt-get update     && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bi  30.8s
------
 > [ 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.1-cli php8.1-dev        php8.1-pgsql php8.1-sqlite3 php8.1-gd        php8.1-curl        php8.1-imap php8.1-mysql php8.1-mbstring        php8.1-xml php8.1-zip php8.1-bcmath php8.1-soap        php8.1-intl php8.1-readline        php8.1-ldap        php8.1-msgpack php8.1-igbinary php8.1-redis php8.1-swoole        php8.1-memcached php8.1-pcov php8.1-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/*:
#7 30.71 Err:1 http://ports.ubuntu.com/ubuntu-ports hirsute InRelease
#7 30.71   Could not connect to ports.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to ports.ubuntu.com:80 (91.189.88.152), connection timed out
#7 30.73 Err:2 http://ports.ubuntu.com/ubuntu-ports hirsute-updates InRelease
#7 30.73   Unable to connect to ports.ubuntu.com:80:
#7 30.73 Err:3 http://ports.ubuntu.com/ubuntu-ports hirsute-backports InRelease
#7 30.73   Unable to connect to ports.ubuntu.com:80:
#7 30.74 Err:4 http://ports.ubuntu.com/ubuntu-ports hirsute-security InRelease
#7 30.74   Unable to connect to ports.ubuntu.com:80:
#7 30.74 Reading package lists...
#7 30.76 W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/hirsute/InRelease  Could not connect to ports.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to ports.ubuntu.com:80 (91.189.88.152), connection timed out
#7 30.76 W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/hirsute-updates/InRelease  Unable to connect to ports.ubuntu.com:80:
#7 30.76 W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/hirsute-backports/InRelease  Unable to connect to ports.ubuntu.com:80:
#7 30.76 W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/hirsute-security/InRelease  Unable to connect to ports.ubuntu.com:80:
#7 30.76 W: Some index files failed to download. They have been ignored, or old ones used instead.
#7 30.77 Reading package lists...
#7 30.77 Building dependency tree...
#7 30.77 Reading state information...
#7 30.77 Package ca-certificates is not available, but is referred to by another package.
#7 30.77 This may mean that the package is missing, has been obsoleted, or
#7 30.77 is only available from another source
#7 30.77
#7 30.77 Package gnupg is not available, but is referred to by another package.
#7 30.77 This may mean that the package is missing, has been obsoleted, or
#7 30.77 is only available from another source
#7 30.77
#7 30.77 E: Package 'gnupg' has no installation candidate
#7 30.77 E: Unable to locate package gosu
#7 30.77 E: Unable to locate package curl
#7 30.77 E: Package 'ca-certificates' has no installation candidate
#7 30.77 E: Unable to locate package zip
#7 30.77 E: Unable to locate package unzip
#7 30.77 E: Unable to locate package git
#7 30.77 E: Unable to locate package supervisor
#7 30.77 E: Unable to locate package sqlite3
#7 30.77 E: Unable to locate package libcap2-bin
#7 30.77 E: Unable to locate package libpng-dev
#7 30.77 E: Unable to locate package python2

For anyone struggling i managed to solve teh issue by running apt-get clean first. For example:

RUN apt-get clean && 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 \
    ...

Where do you put this code, in docker-compose.yml? I’m very new to Sail/Docker/ubuntu and having the same problem.

try inside /vendor/laravel/sail/runtimes/8.1/Dockerfile

I modified the following /vendor/laravel/sail/runtimes/8.1/Dockerfile as follows and made it work. I know it’s bad to modify this file manually. Please also understand that using this is an emergency evacuation action. @taylorotwell

RUN apt-get clean && apt-get update --fix-missing \
  && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 \
 ....
 ....

Switch context: ./vendor/laravel/sail/runtimes/8.1 to context: ./vendor/laravel/sail/runtimes/8.0 and run sail build --no-cache and try again please.

I have a brand new Laravel app on a Mac but have not been able to run Sail or get past this error:

110.3 curl: (60) SSL: no alternative certificate subject name matches target host name 'dl.yarnpkg.com'
110.3 More details here: https://curl.se/docs/sslcerts.html
110.3
110.3 curl failed to verify the legitimacy of the server and therefore could not
110.3 establish a secure connection to it. To learn more about this situation and
110.3 how to fix it, please visit the web page mentioned above.
110.3 gpg: no valid OpenPGP data found.
111.2 Hit:1 https://deb.nodesource.com/node_18.x jammy InRelease
111.2 Get:2 https://dl.yarnpkg.com/debian stable InRelease [17.1 kB]
111.3 Err:2 https://dl.yarnpkg.com/debian stable InRelease
111.3   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
...
110.0 Reading package lists...
110.4 W: GPG error: https://dl.yarnpkg.com/debian stable InRelease: 
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
110.4 E: The repository 'https://dl.yarnpkg.com/debian stable InRelease' is not signed.
------
failed to solve: process "/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 dnsutils librsvg2-bin     && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null     && echo \"deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main\" > /etc/apt/sources.list.d/ppa_ondrej_php.list

Things I’ve tried:

  • turning off iCloud private relay
  • turning on iCloud private relay
  • Running composer update (I’m on composer version 2.5.8)
  • Publishing the PHP 8.2 Dockerfile with php artisan sail:publish and modifying the apt-get command within the Dockerfile to include apt-get clean && apt-get update --fix-missing
  • Running with no-cache option: ./vendor/bin/sail build --no-cache

However the issue The following signatures couldn't be verified because the public key is not available persists. Any ideas about where it is coming from or what I can do to get up and running with Sail?

Having the same problem. I tried with brand new application, I still got the same error

I have a brand new Laravel app on a Mac but have not been able to run Sail or get past this error:

110.3 curl: (60) SSL: no alternative certificate subject name matches target host name 'dl.yarnpkg.com'
110.3 More details here: https://curl.se/docs/sslcerts.html
110.3
110.3 curl failed to verify the legitimacy of the server and therefore could not
110.3 establish a secure connection to it. To learn more about this situation and
110.3 how to fix it, please visit the web page mentioned above.
110.3 gpg: no valid OpenPGP data found.
111.2 Hit:1 https://deb.nodesource.com/node_18.x jammy InRelease
111.2 Get:2 https://dl.yarnpkg.com/debian stable InRelease [17.1 kB]
111.3 Err:2 https://dl.yarnpkg.com/debian stable InRelease
111.3   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
...
110.0 Reading package lists...
110.4 W: GPG error: https://dl.yarnpkg.com/debian stable InRelease: 
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
110.4 E: The repository 'https://dl.yarnpkg.com/debian stable InRelease' is not signed.
------
failed to solve: process "/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 dnsutils librsvg2-bin     && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null     && echo \"deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main\" > /etc/apt/sources.list.d/ppa_ondrej_php.list

Things I’ve tried:

  • turning off iCloud private relay
  • turning on iCloud private relay
  • Running composer update (I’m on composer version 2.5.8)
  • Publishing the PHP 8.2 Dockerfile with php artisan sail:publish and modifying the apt-get command within the Dockerfile to include apt-get clean && apt-get update --fix-missing
  • Running with no-cache option: ./vendor/bin/sail build --no-cache

However the issue The following signatures couldn't be verified because the public key is not available persists. Any ideas about where it is coming from or what I can do to get up and running with Sail?

Had the same problem, after I’ve tried out all the fixes listed above, composer update is what fixed it for me.

The real issue here for the PHP packages is that Ondrej only has packages for the current release of ubuntu and LTS releases, so 21.04 not being current does not have packages in that PPA. The sail docker files should be updated to be based on the current Ubuntu images.

For anyone struggling i managed to solve teh issue by running apt-get clean first. For example:

RUN apt-get clean && 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 \
    ...

Also having the same issue. I’m on Sail v1.23.1

Updating Sail via composer update fixed the issue for me

It fixes my issue too

try inside /vendor/laravel/sail/runtimes/8.1/Dockerfile

You should NEVER edit files in vendor directory. Run php artisan sail:publish and edit published files in ./docker/[php-version]/Dockerfile

For anyone struggling i managed to solve teh issue by running apt-get clean first. For example:

RUN apt-get clean && 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 \
    ...

Where do you put this code, in docker-compose.yml? I’m very new to Sail/Docker/ubuntu and having the same problem.

To whom is having this problem when trying to install php dependencies, the problem for me was: FROM ubuntu:21.04

Because there are no php 8.1 binaries for Ubuntu 21.04. http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php8.1/ Changing to this solved the issue: FROM ubuntu:21.10

In my case i need to change the apt-key

&& 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 \

to

&& wget -qO - 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xE5267A6C' | apt-key add - \
&& wget -qO - 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC300EE8C' | apt-key add - \

In the Dockerfile

For me, the opposite worked. Turning the Private Relay to ON actually fixed the problem! 🤯