Docker 下 Laravel 一直卡在 Installing phpunit/phpunit 龟速得怎么解决?
Windows 的 Docker Desktop
装 larardocker
试的
Docker Desktop 配置
设置:
Docker Engine:
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"features": {
"buildkit": true
},
"registry-mirrors": [
"https://scs7f7m8.mirror.aliyuncs.com",
"https://docker.mirrors.ustc.edu.cn",
"http://f1361db2.m.daocloud.io",
"https://registry.docker-cn.com"
]
}
安装 Laravel 结果:一直卡在 Installing phpunit/phpunit
是真的折磨,卡着不动。有人碰到过吗,提供个思路,感谢!
我测试应该不是镜像问题。其他包很快
$ composer create-project --prefer-dist laravel/laravel blog
.
.
.
- Installing phar-io/version (3.1.0): Extracting archive
- Installing phar-io/manifest (2.0.3): Extracting archive
- Installing myclabs/deep-copy (1.10.2): Extracting archive
# 一直卡在这里
- Installing phpunit/phpunit (9.5.11): Extracting archive
Executing async command (CWD): rm -rf '/var/www/blog/vendor/composer/5f1e0abd'
Executing async command (CWD): rm -rf '/var/www/blog/vendor/composer/8febad9e'
Executing async command (CWD): rm -rf '/var/www/blog/vendor/composer/9f60543a'
.
.
.
composer 配置如下
$ composer config -g -l
[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://mirrors.aliyun.com/composer/
[process-timeout] 300
[use-include-path] false
[allow-plugins]
[use-parent-dir] prompt
[preferred-install] dist
[notify-on-install] true
[github-protocols] [https, ssh]
[gitlab-protocol]
[vendor-dir] vendor (/var/www/vendor)
[bin-dir] {$vendor-dir}/bin (/var/www/vendor/bin)
[cache-dir] /home/laradock/.cache/composer
[data-dir] /home/laradock/.composer
[cache-files-dir] {$cache-dir}/files (/home/laradock/.cache/composer/files)
[cache-repo-dir] {$cache-dir}/repo (/home/laradock/.cache/composer/repo)
[cache-vcs-dir] {$cache-dir}/vcs (/home/laradock/.cache/composer/vcs)
[cache-ttl] 15552000
[cache-files-ttl] 15552000
[cache-files-maxsize] 300MiB (314572800)
[cache-read-only] false
[bin-compat] auto
[discard-changes] false
[autoloader-suffix]
[sort-packages] false
[optimize-autoloader] false
[classmap-authoritative] false
[apcu-autoloader] false
[prepend-autoloader] true
[github-domains] [github.com]
[bitbucket-expose-hostname] true
[disable-tls] false
[secure-http] true
[cafile]
[capath]
[github-expose-hostname] true
[gitlab-domains] [gitlab.com]
[store-auths] prompt
[archive-format] tar
[archive-dir] .
[htaccess-protect] true
[use-github-api] true
[lock] true
[platform-check] php-only
[home] /home/laradock/.composer
问题已解决,有空再把步骤详细写出来。或者碰到的可以自己去看 windows-运行-laravel-响应缓慢的问题