From 8aaf0927d2d25e1887ba86080be50c791b3f2b32 Mon Sep 17 00:00:00 2001 From: shuizhongyueming Date: Thu, 1 Jun 2017 18:11:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8ONBUILD=E7=AB=A0?= =?UTF-8?q?=E8=8A=82=E9=87=8C=E9=9D=A2RUN=E5=91=BD=E4=BB=A4=E7=9A=84?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在ONBUILD章节里面RUN后面要执行的命令被双引号括起来了 在基于demo提供的Dockerfile来构建镜像时,Docker会报类似"/bin/sh: 1: mkdir /app: not found"的错误 去掉之后就一切正常了 --- image/dockerfile/onbuild.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/image/dockerfile/onbuild.md b/image/dockerfile/onbuild.md index 83f88e7..0c2e022 100644 --- a/image/dockerfile/onbuild.md +++ b/image/dockerfile/onbuild.md @@ -10,7 +10,7 @@ ```Dockerfile FROM node:slim -RUN "mkdir /app" +RUN mkdir /app WORKDIR /app COPY ./package.json /app RUN [ "npm", "install" ] @@ -26,7 +26,7 @@ CMD [ "npm", "start" ] ```Dockerfile FROM node:slim -RUN "mkdir /app" +RUN mkdir /app WORKDIR /app CMD [ "npm", "start" ] ``` @@ -48,7 +48,7 @@ COPY . /app/ ```Dockerfile FROM node:slim -RUN "mkdir /app" +RUN mkdir /app WORKDIR /app ONBUILD COPY ./package.json /app ONBUILD RUN [ "npm", "install" ]