laradock 错误与使用相关问题

16 篇文章 0 订阅
6 篇文章 0 订阅

错误一

使用docker build命令构建镜像报:“failed to solve with frontend dockerfile.v0: failed to create LLB definition: unexpected status code [manifests 18.04]: 403 Forbidden”,

出现此原因只需要设置一下docker的setting。

它发生在构建过程中,它是 buildkit 中的一个错误,考虑到 buildkit 仍然不稳定。如果您在 Mac/Windows 上使用 Docker 桌面,您可能还必须在“Docker Engine”json 配置中禁用它。
Docker 桌面 -> 设置 -> Docker 引擎 ->“features”: { buildkit: true}将"features": { buildkit: false}.

请注意,这不是修复,这是一种解决方法,直到 docker 团队中的某个人实施了正确的修复。请在 buildkit 更稳定时再试一次。
在这里插入图片描述

错误二

The stream or file “/var/www/laravel-api/storage/logs/laravel.log” could not be opened in append mode: failed to open stream: Permission denied
参考解决方法:https://stackoverflow.com/questions/63203144/file-could-not-be-opened-in-append-mode-failed-to-open-stream-permission-denie

#第一步 进入 php-fpm 容器
docker-compose exec php-fpm bash

#第二步
chown -R www-data:www-data 项目的文件夹的路径

错误三

https://github.com/laradock/laradock/pull/3251
Laravel Vite 会开启5173端口
vite.config.js文件中添加配置

    server: {
        host: '0.0.0.0',
        hmr: {
            host: 'localhost'
        }
    }

下面示例:

export default defineConfig({
    plugins: [
        laravel({
            input: ['resources/css/app.css', 'resources/js/app.js'],
            refresh: true,
        }),
    ],
    server: {
        host: '0.0.0.0',
        hmr: {
            host: 'localhost'
        }
    }
});

workspace容器构建python太慢时,解决方法

https://github.com/laradock/laradock/issues/3387
修改文件:workspace/Dockerfile部分为以下内容:
get-pip.py文件使用阿里云源,包的镜像使用清华大学的镜像源

###########################################################################
# PYTHON2:
###########################################################################

ARG INSTALL_PYTHON=false

RUN if [ ${INSTALL_PYTHON} = true ]; then \
  apt-get -y install python python-dev build-essential  \
  && curl https://mirrors.aliyun.com/pypi/get-pip.py -o get-pip.py  \
  && python get-pip.py  \
  && rm get-pip.py  \
  && python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip  \
  && pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
  && python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade virtualenv \
;fi

开启mssql,也就是pdo_sqlsrv扩展,构建php-fpm容器时报错,解决方法

https://github.com/laradock/laradock/issues/3357
修改文件:php-fpm/Dockerfile文件内容,
原来部分:

 && curl https://packages.microsoft.com/config/debian/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list \ 

修改为:

&& curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \ 

如果构建完成workspace容器再添加crontab定时任务

需要自己复制文件,容器外的workspace/crontab/laradock文件复制到容器内的/etc/cron.d/laradock,快速命令,进入到容器外laradock所在的目录也就是workspace/crontab目录(文件夹)。然后执行以下命令

# 第一个 laradock 为容器外的 laradock 文件,文件名字就叫做laradock
docker cp laradock 容器ID:/etc/cron.d/laradock

laradock 需开启多个https

ssl ipv6only=on去掉

listen 443 ssl;
listen [::]:443 ssl ipv6only=on;

修改为

listen 443 ssl;
listen [::]:443;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值