Google cloud platform 在Google Cloud运行容器化应用程序时出现Docker错误

Google cloud platform 在Google Cloud运行容器化应用程序时出现Docker错误,google-cloud-platform,dockerfile,google-cloud-run,huggingface-transformers,google-cloud-sdk,Google Cloud Platform,Dockerfile,Google Cloud Run,Huggingface Transformers,Google Cloud Sdk,我试着在谷歌云上运行 我的第一个想法是运行huggingface提供的dockerfiles之一,但这似乎是不可能的 有没有关于如何避免这个错误的想法 Step 6/9 : WORKDIR /workspace ---> Running in xxx Removing intermediate container xxx ---> xxx Step 7/9 : COPY . transformers/ ---> xxx Step 8/9 : RUN cd transfor

我试着在谷歌云上运行

我的第一个想法是运行huggingface提供的dockerfiles之一,但这似乎是不可能的

有没有关于如何避免这个错误的想法

Step 6/9 : WORKDIR /workspace
 ---> Running in xxx
Removing intermediate container xxx
 ---> xxx
Step 7/9 : COPY . transformers/
 ---> xxx
Step 8/9 : RUN cd transformers/ &&     python3 -m pip install --no-cache-dir .
 ---> Running in xxx
←[91mERROR: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
The command '/bin/sh -c cd transformers/ &&     python3 -m pip install --no-cache-dir .' returned a non-zero code: 1
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
←[0m
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

ERROR: (gcloud.builds.submit) build xxx completed with status "FAILURE"
Dockerfile来自:

.dockerginore文件来自谷歌云运行:

----编辑:

根据达斯汀的回答,他成功地找到了工作。我基本上:

  • 将Dockerfile与transformers文件夹一起保留在根文件夹中
  • 将dockerfile中的复制行更新为:
错误是:

Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
这是由于您的
Dockerfile
中的这两行造成的:

COPY . transformers/
RUN cd transformers/ && \
    python3 -m pip install --no-cache-dir .
这将尝试将包含
Dockerfile
的本地目录复制到容器中,然后将其作为Python项目安装


看起来,
Dockerfile
希望在的存储库根目录下运行。您应该克隆repo并将要构建的
Dockerfile
移动到根目录中,然后再次构建。

谢谢Dustin,问题确实出在复制行上。我将用我所做的工作来更新这个问题。
COPY . ./
Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
COPY . transformers/
RUN cd transformers/ && \
    python3 -m pip install --no-cache-dir .