简体   繁体   English

构建自定义 Google Cloud Workstation 映像时无法找到 package apt-get

[英]Unable to locate package apt-get when building a custom Google Cloud Workstation image

I am trying to "build and push a modified workstations image to a container registry" as explained in this previous SO answer .我正在尝试“构建修改后的工作站映像并将其推送到容器注册表”,如前一个SO 答案中所述。

This is the Dockerfile that I am trying to use:这是我正在尝试使用的Dockerfile

FROM us-central1-docker.pkg.dev/cloud-workstations-images/predefined/code-oss:latest

RUN \
  sudo apt-get update && \
  sudo apt-get install -y apache2 \
  sudo apt-get install -y libbz2-dev \
  sudo apt-get install -y php && \
  sudo apt-get install php-mysqli

When I try to build the image using docker build -t my-custom-image.当我尝试使用docker build -t my-custom-image. I eventually receive this error:我最终收到此错误:

E: Unable to locate package apt-get
E: Unable to locate package install
E: Unable to locate package apt-get
E: Unable to locate package install
The command '/bin/sh -c sudo apt-get update &&   sudo apt-get install -y apache2   sudo apt-get install -y libbz2-dev   sudo apt-get install -y php &&   sudo apt-get install php-mysqli' returned a non-zero code: 100

What am I doing wrong?我究竟做错了什么? Why can't I build this image?为什么我不能建立这个形象?

I modified the Dockerfile to this and now it is working:我将Dockerfile修改为此,现在它正在工作:

FROM us-central1-docker.pkg.dev/cloud-workstations-images/predefined/code-oss:latest

RUN \
  sudo apt-get update \
  && sudo apt-get install -y apache2 \
  && sudo apt-get install -y libbz2-dev \
  && sudo apt-get install -y php \
  && sudo apt-get install php-mysqli

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Ubuntu 18.04 LTS 上安装 Google Cloud SDK 后,apt-get 坏了 - Apt-get is broken after install Google Cloud SDK on Ubuntu 18.04 LTS 使用 apt-get 在 Google Compute Engine 实例上安装 Java 8 - Installing Java 8 on a Google Compute Engine instance with apt-get 无法从 EC2 实例执行 sudo apt-get 更新 - Unable to perform sudo apt-get update from EC2 instance 如何在 GCP 的 composer2 上安装 apt-get 包 - how to install apt-get packages on composer2 of GCP 如何在 AWS EC2 实例上安装 apt-get? - How to install apt-get on AWS EC2 instance? 在 aws ec2 中,sudo: apt-get: command not found 错误 - In aws ec2, sudo: apt-get: command not found error 运行失败 dockerfile -> 未知指令:APT-GET - Failed to run dockerfile -> unknown instruction: APT-GET 无法通过 API 更新 Google Cloud Storage 上的图像 - Unable To Update Image On Google Cloud Storage via API 如何使用自定义 Docker 图像运行 Python Google Cloud Dataflow 作业? - How to run a Python Google Cloud Dataflow job with a custom Docker image? Google Cloud Functions Gen2:无法从 europe-west4 中提取 Python 图像 - Google Cloud Functions Gen2: Unable to pull Python image from europe-west4
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM