简体   繁体   English

Docker运行时的自定义脚本

[英]custom script on docker run

I am trying to install the skeleton application of Zend Framework 3 with Docker. 我正在尝试使用Docker安装Zend Framework 3的框架应用程序。

The installation works fine, but I'm not able to run some composer scripts. 安装工作正常,但是我无法运行一些作曲家脚本。 In the composer.json there are some custom composer scripts, which should be generally launched with composer.json ,有一些自定义的composer脚本,通常应使用

composer cs-fix

I would like to lauch there commands with the Composer Docker image , using 我想在Composer Docker镜像中放下命令,使用

docker run --rm -ti --volume $PWD:/app composer cs-fix

When I try to do this, I obtain the following error 当我尝试执行此操作时,出现以下错误

/docker-entrypoint.sh: line 60: exec: cs-fix: not found

Is my command wrong? 我的命令错了吗?

Found it! 找到了! Instead of trying to run the custom composer script, I need to use the special run-script command, as in 无需尝试运行自定义作曲家脚本,而是需要使用特殊的run-script命令,如下所示:

docker run --rm -it --volume $PWD:/app composer run-script "cf-fix"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM