簡體   English   中英

/bin/sh: =: 從自定義鏡像運行 docker 容器時未找到

[英]/bin/sh: =: not found when running docker container from custom image

我嘗試從構建的映像運行容器並收到錯誤 /bin/sh: =:。 有沒有人知道如何解決它。 下面是我的 Dockerfile。 index.js 和 package.json 都與 Dockerfile 位於同一文件夾中。

package.json

{
  "dependencies":{
    "express":"*"
  },
  "scripts":{
    "start":"node index.js"
  }
}

Dockerfile

FROM node:14.4.0-alpine3.10
COPY ./ ./
RUN npm install
CMD = ['npm', 'start']

CMD的輸入被解析為 JSON 數組,這意味着您必須使用雙引號而不是單引號。 此外,擺脫=

CMD ["npm", "start"]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM