【发布时间】:2026-02-13 23:35:01
【问题描述】:
我不明白为什么 Sail 安装的是 PHP 8.1 而不是 8.0。它暂时破坏了我的应用程序。
这是 docker-compose.yml:
# For more information: https://laravel.com/docs/sail
version: '3'
services:
laravel.test:
build:
context: ./docker/8.0
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.0/app
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT:-80}:80'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
volumes:
- '.:/var/www/html'
networks:
- sail
depends_on:
- mysql
- redis
...
这是 Docker 文件:https://github.com/laravel/sail/blob/1.x/runtimes/8.0/Dockerfile
我已经重建了很多次图像,但我仍然得到这个:
sail@c5f380167b79:/var/www/html$ php -v
PHP 8.1.2 (cli) (built: Jan 24 2022 10:42:51) (NTS)
【问题讨论】:
标签: php docker dockerfile