Home  >  Article  >  PHP Framework  >  Solve the problem that the ubuntu software source is very slow or the connection fails when Laravel installs Sail

Solve the problem that the ubuntu software source is very slow or the connection fails when Laravel installs Sail

藏色散人
藏色散人forward
2021-03-17 17:31:282870browse

The following tutorial column will introduce to you how to solve the problem that the ubuntu software source is very slow or the connection fails when Laravel installs sail. I hope it will be helpful to friends in need!

Laravel ubuntu software source is very slow or connection failed when installing sail. SolutionSolve the problem that the ubuntu software source is very slow or the connection fails when Laravel installs Sail

Modify Laravel sail ubuntu software source

Modify the file
C:Users2018977115-pc Your project name vendorlaravelsailruntimes8.0

Under Dockerfile

Add

RUN  sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN  sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list

RUN  apt-get clean

before RUN apt-get update and then in Linux After executing the

create project below, you can navigate to the application directory and start Laravel Sail. Laravel Sail provides a simple command line interface for interacting with Laravel's default Docker configuration:
cd 你的项目名字

./vendor/bin/sail up

The first time you run the Sailup command, Sail's application container will be built on your computer. This may take several minutes. Don't worry, subsequent attempts to launch Sail will be faster.

Once the application's Docker container is started, you can access the application in a web browser at: http://localhost/index.php.

The above is the detailed content of Solve the problem that the ubuntu software source is very slow or the connection fails when Laravel installs Sail. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete