记录一下第一次安装laradock踩到的各种坑
坑1:
错误详情:
0curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

解决过程:
- 最开始我是在腾讯云轻量服务器试水,查了下,改host文件,无法解决
- 然后换阿里云轻量服务器,改host文件,无法解决
- 自己主机win10专业版,改host文件,成功解决,接下来的坑所处环境全是win10专业版
- 通过的www.ipaddress.com/ 查询的
raw.githubusercontent.comIP地址

坑2:
错误详情:
Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php-igbinary/php8.0-igbinary_3.2.1+2.0.8-1+ubuntu18.04.1+deb.sury.org+1_amd64.deb Connection timed out

解决过程:
- 修改.env文件,换源
CHANGE_SOURCE的值改为true,时区改为,同时把其他几个镜像也改了,无法解决# 换源 CHANGE_SOURCE=true # composer镜像 WORKSPACE_COMPOSER_REPO_PACKAGIST=https://mirrors.aliyun.com/composer/ # node镜像 WORKSPACE_NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node # npm镜像 WORKSPACE_NPM_REGISTRY=https://registry.npm.taobao.org # 修改时区 WORKSPACE_TIMEZONE=PRC - 在laradock的GitHub的Issues找到解决办法,链接github.com/laradock/laradock/issue... ,是通过在 workspace 的 Dockfile 中 增加一段:
find /etc/apt/sources.list.d/ -type f -name "ondrej-ubuntu-php-xenial.list" -exec sed -i.bak -r 's#deb(-src)?\s*http(s)?://ppa.launchpad.net#deb\1 https\2://launchpad.proxy.ustclug.org#ig' {} \; && \ //请注意,ubuntu 18.04 用下面这个 //请注意,ubuntu 18.04 用下面这个 find /etc/apt/sources.list.d/ -type f -name "ondrej-ubuntu-php-bionic.list" -exec sed -i.bak -r 's#deb(-src)?\s*http(s)?://ppa.launchpad.net#deb\1 https\2://launchpad.proxy.ustclug.org#ig' {} \; && \
坑3:
就是前段那一系列node环境,两个解决办法
方法1:
(参考的论坛的大佬(@paco)的配置,我没有采用,不知道效果)
WORKSPACE_BASE_IMAGE_TAG_PREFIX=latest
WORKSPACE_COMPOSER_GLOBAL_INSTALL=true
WORKSPACE_COMPOSER_AUTH=false
WORKSPACE_COMPOSER_REPO_PACKAGIST=
WORKSPACE_NVM_NODEJS_ORG_MIRROR=
WORKSPACE_INSTALL_NODE=false #这里
WORKSPACE_NODE_VERSION=node #这里
WORKSPACE_NPM_REGISTRY=
WORKSPACE_INSTALL_YARN=false #这里
WORKSPACE_YARN_VERSION=latest
WORKSPACE_INSTALL_NPM_GULP=false #这里
WORKSPACE_INSTALL_NPM_BOWER=false #这里
WORKSPACE_INSTALL_NPM_VUE_CLI=false #这里
WORKSPACE_INSTALL_NPM_ANGULAR_CLI=false #这里
方法2:科学上网(我采用的这个)
总结:坑多,使用laradock或Homestead对于小白来说难度差不多,甚至更难(国内网络环境导致)。总共花了约整整12个小时
本作品采用《CC 协议》,转载必须注明作者和本文链接
关于 LearnKu
我是搞的fanqiang在cmd代理了下。然后嗖嗖嗖就完事了
是的, 服务器上跑不通
我直接放弃了 每次重新build都各种问题 直接用 wsl + ubuntu 不香吗
cmd fq代理就没问题 :joy:
提示这个有无大佬懂怎么解决 D:\hjworkspace\laradock>docker compose up -d nginx mysql [+] Building 3.1s (7/119) => [workspace internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [workspace internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 73.41kB 0.0s => [workspace internal] load metadata for docker.io/laradock/workspace:latest-8.2 1.2s => [workspace internal] load build context 0.0s => => transferring context: 447B 0.0s => [workspace 1/115] FROM docker.io/laradock/workspace:latest-8.2@sha256:0ade667f0c02076e5799250139242617670da 0.0s => CACHED [workspace 2/115] RUN if [ false = true ]; then sed -i 's/ports.ubuntu.com/mirrors.tuna.tsinghua 0.0s
=> ERROR [workspace 3/115] RUN set -xe; apt-get update -yqq && pecl channel-update pecl.php.net && 1.7s
1.729 E: The repository 'ppa.launchpad.net/ondrej/php/ubuntu focal Release' no longer has a Release file.
failed to solve: process "/bin/sh -c set -xe; apt-get update -yqq && pecl channel-update pecl.php.net && groupadd -g ${PGID} laradock && useradd -l -u ${PUID} -g laradock -m laradock -G docker_env && usermod -p "*" laradock -s /bin/bash && apt-get install -yqq apt-utils libzip-dev zip unzip php${LARADOCK_PHP_VERSION}-zip nasm && php -m | grep -q 'zip'" did not complete successfully: exit code: 100