构建容器并检查其运行后,我尝试访问 localhost:8080,但出现服务器错误,我不明白为什么。容器日志如下:
2024-02-14 10:18:40 +++ Starting SSH +++
2024-02-14 10:18:40 Starting OpenBSD Secure Shell server: sshd.
2024-02-14 10:18:40 +++ SSH started +++
2024-02-14 10:18:40 +++ Invoke Wordpress variables +++
2024-02-14 10:18:40 +++ Variables invoked +++
2024-02-14 10:18:40 +++ Starting Memcached +++
2024-02-14 10:18:40 Starting memcached: memcached.
2024-02-14 10:18:40 +++ Memcached started +++
2024-02-14 10:18:40 +++ Starting Redis Cache +++
2024-02-14 10:18:40 Starting redis-server: redis-server.
2024-02-14 10:18:40 +++ Redis Cache started +++
2024-02-14 10:18:40 +++ Starting PHP-FPM & Nginx +++
2024-02-14 10:18:40 sed: -e expression #1, char 30: unknown option to `s'
2024-02-14 10:18:40 sed: -e expression #1, char 19: unknown option to `s'
2024-02-14 10:18:40 [14-Feb-2024 09:18:40] NOTICE: fpm is running, pid 61
2024-02-14 10:18:40 [14-Feb-2024 09:18:40] NOTICE: ready to handle connections
2024-02-14 10:18:45 127.0.0.1 - 14/Feb/2024:09:18:45 +0000 "GET /index.php" 500
2024-02-14 10:18:50 127.0.0.1 - 14/Feb/2024:09:18:50 +0000 "GET /index.php" 500
我检查了环境变量,它们似乎设置正确,docker-compose.yml 也是如此。
看起来
sed
脚本应该在 GNU/Linux 机器上运行。
macOS 上的 sed
语法略有不同。
如果没有看到
sed
命令,很难给你更好的建议。
您可以在此处阅读有关 macOS 与 GNU/Linux
sed
差异的更多信息:
带 -i 选项的 sed 命令在 Mac 上失败,但在 Linux 上工作