代码之家  ›  专栏  ›  技术社区  ›  eozzy

无法在M1 Macbook上启动云运行容器

  •  0
  • eozzy  · 技术社区  · 4 年前

    我还没有在我的M1 Macbook上安装Rosetta。安装了Docker和所有DEP,这甚至工作了几次,但不确定是什么原因突然导致了这个错误:

    Starting to run the app using configuration 'Cloud Run: Run/Debug Locally' from .vscode/launch.json...
    To view more detailed logs, go to Output channel : "Cloud Run: Run/Debug Locally - Detailed"
    Dependency check started
    Dependency check succeeded
    Starting minikube, this may take a while.............
    minikube successfully started
    The minikube profile 'cloud-run-dev-internal' has been scheduled to stop automatically after exiting Cloud Code. To disable this on future deployments, set autoStop to false in your launch configuration /Users/myname/Code/myprojectAPI/.vscode/launch.json
    Configuring minikube gcp-auth addon
    Using GCP project 'myproject-com' with minikube gcp-auth
    
    
    Update initiated
    Build started for artifact myprojectapi
    Build completed for artifact myprojectapi
    
    Deploy started
    Deploy completed
    
    Status check started
    Resource pod/myprojectapi-8695998b94-9lk7d status updated to In Progress
    Resource pod/myprojectapi-8695998b94-9lk7d status updated to In Progress
    Resource deployment/myprojectapi status failed with waiting for rollout to finish: 0 of 1 updated replicas are available...
    Status check failed
    
    The image was built but failed to start on the cluster. Because you are on an ARM64 machine, it is likely that you built an ARM64 image for an x86_64 cluster.
    Update failed with error code STATUSCHECK_CONTAINER_TERMINATED
    1/1 deployment(s) failed
    Skaffold exited with code 1.
    Cleaning up...
    Finished clean up.
    

    Dockerfile :

    FROM gcr.io/google.com/cloudsdktool/cloud-sdk:slim
    
    RUN set -ex; \
      apt-get -y update; \
      curl -fsSL https://deb.nodesource.com/setup_17.x | bash -; \
      apt-get -y install nodejs; \
      apt-get -y install ghostscript; \
      apt-get -y install pngquant; \
      rm -rf /var/lib/apt/lists/*
    
    # Create and change to the app directory.
    WORKDIR /usr/src/app
    
    # Copy application dependency manifests to the container image.
    # A wildcard is used to ensure both package.json AND package-lock.json are copied.
    # Copying this separately prevents re-running npm install on every code change.
    COPY package*.json ./
    
    # Install dependencies.
    # If you add a package-lock.json speed your build by switching to 'npm ci'.
    RUN npm ci --only=production
    # RUN npm install --production
    
    
    # Copy local code to the container image.
    COPY . ./
    
    # Run the web service on container startup.
    CMD [ "npm", "start" ]
    

    我正在使用云代码扩展在VS代码中部署“云运行模拟器”。

    我做错了什么?

    0 回复  |  直到 4 年前
    推荐文章