gpt4 book ai didi

php - 将bin文件复制到docker容器会导致错误

转载 作者:行者123 更新时间:2023-12-02 20:12:45 25 4
gpt4 key购买 nike

我正在尝试设置一个docker-compose系统,我想在启动时将开发工具复制到/usr/local/bin/

那就是我的docker-compose.yml:

version: '3'

services:
web:
build: docker/container/nginx
ports:
- 4000:80
volumes: &m2volume
- ./src:/var/www/html/
- ./docker/data/bin/:/usr/local/bin/
- ~/.composer:/var/www/.composer
networks: &m2network
- www
links:
- "php"
- "mariadb:mysql"
mariadb:
image: mariadb
ports:
- 8001:3306
networks: *m2network
ports:
- "3307:3306"
environment:
MYSQL_ROOT_PASSWORD: magento2
MYSQL_DATABASE: db
MYSQL_USER: magento2
MYSQL_PASSWORD: magento2
volumes:
- ./docker/container/db/docker-entrypoint-initdb.d/:/docker-entrypoint-initdb.d/
- ./docker/container/db/conf.d:/etc/mysql/conf.d
- ./docker/data/mariadb:/var/lib/mysql

php:
build: docker/container/fpm
volumes: *m2volume
networks: *m2network

networks:
www:

如果我在其中保留 - ./docker/data/bin/:/usr/local/bin/,则会收到错误消息:
ERROR: for m2_php_1  Cannot start service php: oci runtime error: container_linux.go:262: starting container process caused "exec: \"docker-php-entrypoint\": executable file not found in $PATH"
Starting m2_mariadb_1 ... done

ERROR: for php Cannot start service php: oci runtime error: container_linux.go:262: starting container process caused "exec: \"docker-php-entrypoint\": executable file not found in $PATH"

如果我取消注释,一切正常。

我在这里做错了什么?

最佳答案

如果我正确理解了这一点,并且映射了./docker/data/bin/:/usr/local/bin/卷会导致异常,则可能是因为mariadb镜像中定义了entrypoint

更重要的是,您正在覆盖/usr/local/bin容器文件夹,该文件夹可能包含入口点中使用的可执行文件。当消失时,您会得到一个错误。

关于php - 将bin文件复制到docker容器会导致错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45754248/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com