我为 Magento 数据库和文件系统数据构建了一个数据卷容器。它不需要做任何事情,所以我把它做成了准系统,只scratch
需要几个文件true-asm
就可以运行了。
然后我编写了一个 fig.yml 文件,将它与 mysql 和 php:5.4-apache 放在一起,以实际运行一个 Magento 实例。但是我第二次运行fig up
,数据容器总是无法启动。这是一个简化的示例:
$ cat fig.yml
magedata:
image: kojiromike/magedata:empty
command: /true-asm
$ fig up
Creating docker_magedata_1...
Attaching to docker_magedata_1
docker_magedata_1 exited with code 0
Gracefully stopping... (press Ctrl+C again to force)
$ fig up
Recreating docker_magedata_1...
Cannot start container c3b697f769301bb59a1ced05924990a68a02f1e554c9038f801574ed7c001aa1: exec: "echo": executable file not found in $PATH
当明确说要运行时,为什么要fig up
尝试运行?echo
command
/true-asm
更新(回答评论者的问题)
这个镜像没有 Dockerfile,但是入口点可以设置在fig.yml
. 如果我确实设置了它, fig 似乎会echo
在第二次运行时将其重写为。
$ cat fig.yml
magedata:
image: kojiromike/magedata:empty
command: /true-asm
entrypoint: /true-asm
$ fig up
Creating foo_magedata_1...
Attaching to foo_magedata_1
foo_magedata_1 exited with code 0
Gracefully stopping... (press Ctrl+C again to force)
$ docker inspect --format='{{.Config.Entrypoint}}' $(docker ps -ql)
[/true-asm]
$ fig up
Recreating foo_magedata_1...
Cannot start container 8a54ac0e60953f1b4e2aaefe5702f04ed1953bed3eea1d8871441a989973fee5: exec: "echo": executable file not found in $PATH
$ docker inspect --format='{{.Config.Entrypoint}}' $(docker ps -ql)
[echo]