我有以下简单的Dockerfile只是为了测试安装PhantomJS
FROM tomcat:8.0.52-jre8-alpine
# NPM & PhantomJS
# 2.11 actually installs 2.1.1
ENV PHANTOM_VERSION="2.1.16"
RUN apk update \
&& apk add --update tar curl nodejs \
&& npm --version \
&& npm install phantomjs-prebuilt@${PHANTOM_VERSION} --phantomjs_cdnurl=https://bitbucket.org/ariya/phantomjs/downloads \
&& ls -al /usr/local/tomcat/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs \
&& ln -s /usr/local/tomcat/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /usr/bin/phantomjs \
&& echo "PhantomJS binary: `which phantomjs`" \
&& `which phantomjs` --version
当我尝试构建图像时,我得到了这个。
PhantomJS binary: /usr/bin/phantomjs
/bin/sh: /usr/bin/phantomjs: not found
The command '/bin/sh -c apk update && apk add --update tar curl nodejs && npm --version && npm install phantomjs-prebuilt@${PHANTOM_VERSION} --phantomjs_cdnurl=https://bitbucket.org/ariya/phantomjs/downloads && ln -s /usr/local/tomcat/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /usr/bin/phantomjs && which phantomjs && `which phantomjs` --version' returned a non-zero code: 127
如果我确实运行了容器,然后执行
$ phantomjs
我也得到not found
。我在那里看到二进制文件和链接。
为什么?