【发布时间】:2021-10-23 13:44:00
【问题描述】:
我从 GCP 项目中的特定目录构建 Cloud Run 容器时遇到错误。这个特定目录在过去一直是正确构建的,并且自上次成功构建以来没有对其进行任何更改。
然而,最近,我想为这个目录启动一个管道,所以我在代码中添加了几个井号(因此 Cloud Build 触发器可以开始构建 Run 容器 - 此外,添加这些井号应该不影响代码中的任何内容)。在这个过程中,出现了这个错误:
E: Unable to locate package python3.7-dev
E: Couldn't find any package by glob 'python3.7-dev'
E: Couldn't find any package by regex 'python3.7-dev'
The command '/bin/sh -c apt-get update && apt-get upgrade -y && apt-get install -y wget
unzip xvfb libxtst6 libxrender1 python3.7-dev build-essential net-tools' returned a non-zero
code: 100
鉴于没有任何改变,我不确定是什么导致了这个错误。此错误消息可能意味着什么,我应该采取什么措施来修复它?任何帮助表示赞赏,如果需要更多信息,我很乐意更新问题。谢谢!
编辑:这些是 dockerfile 内容:
FROM python:3.7-slim
# Allow statements and log messages to immediately appear in the Cloud Run logs
ENV PYTHONUNBUFFERED True
# install dependencies
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y wget unzip xvfb libxtst6 libxrender1 python3.7-dev build-essential net-tools
#RUN apt-get install -y procps
# set environment variables
ENV TWS_INSTALL_LOG=/root/Jts/tws_install.log \
ibcIni=/root/ibc/config.ini \
ibcPath=/opt/ibc \
javaPath=/opt/i4j_jres \
twsPath=/root/Jts \
twsSettingsPath=/root/Jts
# make dirs
RUN mkdir -p /tmp && mkdir -p ${ibcPath} && mkdir -p ${twsPath}
# copy over IB Gateway
COPY Jts /root/Jts
COPY i4j_jres /home/mmr/.i4j_jres
# download IBC
RUN wget -q -O /tmp/IBC.zip https://github.com/IbcAlpha/IBC/releases/download/3.8.2/IBCLinux-3.8.2.zip
RUN unzip /tmp/IBC.zip -d ${ibcPath}
RUN chmod +x ${ibcPath}/*.sh ${ibcPath}/*/*.sh
# copy IBC/Jts configs
COPY ibc/config.ini ${ibcIni}
# copy cmd script
WORKDIR /home
COPY cmd.sh cmd.sh
RUN chmod +x cmd.sh
# set display environment variable (must be set after TWS installation)
ENV DISPLAY=:0
WORKDIR /home
COPY ib_server ./ib_server
COPY __init__.py .
COPY requirements.txt .
RUN pip install -r /home/requirements.txt
# execute cmd script to start Xvfb and gunicorn
CMD ./cmd.sh
# CMD tail -f /dev/null
当对目录进行更改并推送时会触发容器创建,这就是为什么我必须添加井号并推送以启动构建。
【问题讨论】:
-
发布你的 dockerfile
-
如何触发容器创建?
-
我已经添加了 dockerfile 并指定了如何触发容器创建。
标签: dependencies google-cloud-run google-cloud-build