php $paths,docker – 在$PATH中找不到可执行文件

我在PHP-FPM 7.1的Dockerfile中工作.我用以下行结束Dockerfile:

CMD ["php71-php-fpm"]

因为我使用的是docker-compose,所以这就是我启动容器的方法:

docker-compose up -d

容器按照以下行编译得很好(显然):

Successfully built 014e24455b53

WARNING: Image for service php was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.

Creating php71-fpm

但它以以下错误结束:

ERROR: for php Cannot start service php: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\"php71-php-fpm\\\": executable file not found in $PATH\"\n"

ERROR: Encountered errors while bringing up the project.

我尝试过以下方法:

CMD php71-php-fpm

然后错误消失,然后容器退出代码127:

> docker-compose ps

Name Command State Ports

-------------------------------------------------------

php71-fpm /bin/sh -c php71-php-fpm Exit 127

我在这里缺少什么?

UPDATE

我找到了以下答案here:

Value 127 is returned by /bin/sh when the given command is not found

within your PATH system variable and it is not a built-in shell

command. In other words, the system doesn’t understand your command,

because it doesn’t know where to find the binary you’re trying to

call.

这让我觉得文件php71-paths.sh没有被执行,因此路径设置不正确.

再一次,我错过了什么?

这个php71-fpm将与另一个运行Nginx的容器链接(这是一个WIP和我学习Docker的方式)

这是完整的Dockerfile供您查看.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值