Open zhangyibin1991 opened 4 years ago
local.Dokcerfile文件中的命令ADD phantomjs /opt/phantomjs-2.1.1会以/opt/phantomjs-2.1.1作为文件名将phantomjs添加到镜像中,所以构建过程中会提示chmod: /opt/phantomjs-2.1.1/phantomjs: Not a directory错误,因为在目录/opt/phantomjs-2.1.1中并不存在文件phantomjs。
local.Dokcerfile
ADD phantomjs /opt/phantomjs-2.1.1
/opt/phantomjs-2.1.1
phantomjs
chmod: /opt/phantomjs-2.1.1/phantomjs: Not a directory
添加文件分隔符/后可以跑通。 ADD phantomjs /opt/phantomjs-2.1.1 => ADD phantomjs /opt/phantomjs-2.1.1/
/
ADD phantomjs /opt/phantomjs-2.1.1/
部署不起来。我修改成如下才可以: ARG PHANTOMJS_BZ2=phantomjs-2.1.1-linux-x86_64.tar.bz2
RUN mkdir -p /opt/phantomjs-2.1.1/phantomjs
ADD $PHANTOMJS_BZ2 /opt/phantomjs-2.1.1/phantomjs
local.Dokcerfile
文件中的命令ADD phantomjs /opt/phantomjs-2.1.1
会以/opt/phantomjs-2.1.1
作为文件名将phantomjs
添加到镜像中,所以构建过程中会提示chmod: /opt/phantomjs-2.1.1/phantomjs: Not a directory
错误,因为在目录/opt/phantomjs-2.1.1
中并不存在文件phantomjs
。添加文件分隔符
/
后可以跑通。ADD phantomjs /opt/phantomjs-2.1.1
=>ADD phantomjs /opt/phantomjs-2.1.1/