我是 Docker 的超级新手,最近将一个项目从 App Engine 转移到 Cloud Run。很容易,喜欢它。
但是,现在我正在尝试更新图像(因为我添加了一些新代码)。我知道我需要进入一个实际的容器来更新图像(我想?)但是当我尝试这样做时docker run
,我得到了一个unexpected operator
错误。
这让我非常生气。
我无法启动容器。我无法编辑我的图像。我无法在 Cloud Run 上上传新版本。
据我所知,unexpected operator
必须处理 Dockerfile 的错误。因此,这是我的 Dockerfile(由 Google 提供,用于在 Cloud Run 上部署映像)。
Dockerfile
#Use the official Node.js 10 image
#https://hub.docker.com/_/node
FROM node:10
#Create and change to the app directory
WORKDIR /usr/src/app
#Copy application dependency manifests to the container image.
#A wild card is used to ensure both package.json AND package-lock.json are copied.
#Copying this separately prevents re0running npm install on every code change.
COPY *package.json ./
#Install production dependences
RUN npm install --only=production
#COPY local code to the container image
COPY . .
#Run the web service on container startup
CMD [ "npm", "start" ]
unexpected operator
我得到的具体错误是/bin/sh: 1: [: npm.: unexpected operator
老实说,我现在不知道该怎么办。我想我需要第二双眼睛来看看它。