1
我有一個非常簡單的dockerfile:dockerfile,如何支持docker運行選項-d,-v和-p?
FROM ubuntu:16.04
ADD node-v6.11.1 /usr/local
RUN ln -s /usr/local/bin/node /usr/local/bin/nodejs
RUN node -v
COPY server /server
RUN cd /server && npm install
EXPOSE 80 443
VOLUME ["/server/public"]
CMD cd /server && node server
sudo docker run server
按預期工作。
sudo docker run server -v /public:/server/public
結果:starting container process caused "exec: \"-v\": executable file not found in $PATH".
sudo docker run server -d
結果: starting container process caused "exec: \"-d\": executable file not found in $PATH"
sudo docker run server -p 80:80
給出類似的錯誤。
聖**,我浪費了太多的時間。 –
@ J.Doe感動男人後悔不值得! –