月&盾

生活的精彩要去发现,而不是等待出现

文章详情

Dockerfile CMD命令没有执行npm start

Dockerfile

FROM hub.c.163.com/public/nodejs:6.11.0

WORKDIR /app

COPY . /app

RUN npm install

EXPOSE 3000

# CMD ["npm", "start"]
ENTRYPOINT ["npm", "start"]

docker ps:

CONTAINER ID    IMAGE  COMMAND                  
59988bd90894    myfd   "/bin/sh -c '/usr/..."   

在Dockerfile中配置了CMD ["npm", "start"],docker ps后显示COMMAND为"/bin/sh -c '/usr/..." 改为ENTRYPOINT ["npm", "start"]就可以了

关键字词:docker