小编Wha*_*nce的帖子

Laravel docker 图像“无法打开输入文件:/var/www/html/artisan”

我正在尝试构建和运行一个 Laravel docker 镜像,该镜像最初是通过 Laravel 帆生成的。使用时docker-compose up,它可以正确运行并且我能够访问该站点。然而,运行docker build docker/7.4/ -t <tagname>后会docker run <tagname>导致以下错误日志:

示例错误日志,显示“无法打开输入文件:/var/www/html/artisan”

我已将此错误跟踪到我的 supervisord.conf 文件,它试图在其中调用/var/www/html/artisan serve,但似乎无法解决它。

supervisord.conf:

[supervisord]
nodaemon=true
user=root
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid

[program:php]
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80
user=sail
environment=LARAVEL_SAIL="1"
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
Run Code Online (Sandbox Code Playgroud)

这也是我正在使用的 Dockerfile,以及它运行的启动容器脚本

Dockerfile:

FROM ubuntu:20.04

LABEL maintainer="Taylor Otwell"

ARG WWWGROUP

WORKDIR /var/www/html

ENV DEBIAN_FRONTEND noninteractive
ENV TZ=UTC

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update \
    && apt-get install -y …
Run Code Online (Sandbox Code Playgroud)

php laravel docker docker-compose

4
推荐指数
1
解决办法
1253
查看次数

标签 统计

docker ×1

docker-compose ×1

laravel ×1

php ×1