修复在ONBUILD章节里面RUN命令的使用错误

在ONBUILD章节里面RUN后面要执行的命令被双引号括起来了
在基于demo提供的Dockerfile来构建镜像时,Docker会报类似"/bin/sh: 1: mkdir /app: not found"的错误
去掉之后就一切正常了
This commit is contained in:
shuizhongyueming 2017-06-01 18:11:18 +08:00
parent 0a0d4a015e
commit 8aaf0927d2

View File

@ -10,7 +10,7 @@
```Dockerfile ```Dockerfile
FROM node:slim FROM node:slim
RUN "mkdir /app" RUN mkdir /app
WORKDIR /app WORKDIR /app
COPY ./package.json /app COPY ./package.json /app
RUN [ "npm", "install" ] RUN [ "npm", "install" ]
@ -26,7 +26,7 @@ CMD [ "npm", "start" ]
```Dockerfile ```Dockerfile
FROM node:slim FROM node:slim
RUN "mkdir /app" RUN mkdir /app
WORKDIR /app WORKDIR /app
CMD [ "npm", "start" ] CMD [ "npm", "start" ]
``` ```
@ -48,7 +48,7 @@ COPY . /app/
```Dockerfile ```Dockerfile
FROM node:slim FROM node:slim
RUN "mkdir /app" RUN mkdir /app
WORKDIR /app WORKDIR /app
ONBUILD COPY ./package.json /app ONBUILD COPY ./package.json /app
ONBUILD RUN [ "npm", "install" ] ONBUILD RUN [ "npm", "install" ]