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

totoosa's avatar

Hello, anytime i try to spin up a new laravel project within docker + wsl linux 20.04. My build process get terminated or stops here

this is the response from my terminal, i can't seem to get past this process, is there something broken with my setup and how can i fix such issues. Below is the response i get in my terminal and i'm not doing anything entirely different than following the installation guide included in laravel docs ✔ meilisearch Pulled 2.8s ✔ redis Pulled 3.2s ✔ selenium Pulled 2.8s ✔ mailpit Pulled 3.0s ✔ mysql Pulled 3.8s [+] Building 711.8s (8/15) docker:default => [laravel.test internal] load build definition from Do 0.0s => => transferring dockerfile: 3.25kB 0.0s => [laravel.test internal] load metadata for docker.io/l 3.1s => [laravel.test internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [laravel.test internal] load build context 0.0s => => transferring context: 100B 0.0s => [laravel.test 1/11] FROM docker.io/library/ubuntu:22 0.0s => CACHED [laravel.test 2/11] WORKDIR /var/www/html 0.0s => CACHED [laravel.test 3/11] RUN ln -snf /usr/share/zo 0.0s => ERROR [laravel.test 4/11] RUN apt-get update & 708.6s

708.4 Reading package lists... 708.6 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease 403 connecting to archive.ubuntu.com:80: connecting to 185.125.190.39:80: dial tcp 185.125.190.39:80: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. [IP: 91.189.91.81 80] 708.6 E: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.

failed to solve: process "/bin/sh -c apt-get update && mkdir -p /etc/apt/keyrings && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch ffmpeg && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c'

0 likes
4 replies
LaryAI's avatar
Level 58

It looks like you're encountering an issue during the Docker build process for a Laravel project, specifically at the step where apt-get update is being run. The error message indicates that there's a problem fetching packages from the Ubuntu repository, which could be due to network issues or repository configuration problems.

Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Check Internet Connectivity: Ensure that your WSL instance has proper internet connectivity. You can test this by running a simple command like ping google.com from your WSL terminal.

  2. Check Docker's Network Configuration: Sometimes Docker might have issues with networking, especially when running on WSL. You can try restarting Docker and WSL to see if that resolves the issue.

  3. Use a Different Ubuntu Mirror: The default Ubuntu mirror might be down or having issues. You can switch to a different mirror by modifying the Dockerfile to use a different base image URL or by changing the sources list in Ubuntu.

  4. Retry the Build: Transient network issues can cause this problem. Simply retrying the build process after some time might work if the issue was temporary.

  5. Update WSL and Docker: Make sure you're running the latest versions of WSL and Docker, as updates often include bug fixes and improvements that could resolve your issue.

  6. Check Dockerfile Syntax: Ensure that there are no syntax errors in your Dockerfile that might be causing the issue.

  7. Manually Fetch GPG Keys: The error also indicates an issue with fetching GPG keys. You might want to manually fetch the GPG keys in your Dockerfile before running apt-get update.

Here's a modified step in your Dockerfile that attempts to manually add the GPG key before updating the package list:

RUN apt-get update && \
    apt-get install -y gnupg && \
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C && \
    apt-get update && \
    mkdir -p /etc/apt/keyrings && \
    apt-get install -y gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch ffmpeg

Remember to replace 4F4EA0AAE5267A6C with the actual GPG key you need for your repository.

If none of these steps resolve the issue, you may want to provide more details about your Docker setup or seek further assistance from the Docker or WSL communities.

totoosa's avatar
totoosa
OP
Best Answer
Level 3

Incase any encounters this issue with using the new laravel, php 8.3 sail etc. I couldn't pinpoint where the error came from but was only able to fix by installing a fresh distro of ubuntu, 22.04 to be exact and then install laravel from on there

wailerz99's avatar

@totoosa im experiencing this right now. ive been stuck for 3 days now. i tried everything. uninstalled docker and wsl2. multiple ubuntu distro. so frustrated now.

Please or to participate in this conversation.