[英]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.