我有两个码头图片:php和phantomjs。 我用它们来构建简单的命令行脚本应用程序。 我也有方便的run.bat脚本包含:
docker run -it --rm --name my-running-script -v %cd%:/usr/src/myapp -w /usr/src/myapp php:7.0-cli php
我该怎么做才能将nodejs添加到我的php图像中?
我希望能够使用像#34; phantomjs --help"在php容器里面。
我已尝试搜索类似问题的文档,但尚未找到相关提示。
这是我使用的幻像图像:https://hub.docker.com/r/wernight/phantomjs/ for php image im using: https://hub.docker.com/_/php/
答案 0 :(得分:1)
如果你想在你的php容器中使用phantomjs,而不是使用一个php
和另一个phantomjs
的docker镜像,你只需要用这两个包构建你自己的cutom docker镜像。
您似乎使用debian:stretch
作为phantomjs
https://hub.docker.com/r/wernight/phantomjs/~/dockerfile/的基本图片
你只需要谷歌在debian上安装php。可能它应该是dockerfile apt-get install -y php
中的另一行。然后构建此图像并使用它。