gcloud artifact registry 出错:INVALID_ARGUMENT: 不支持 Maven 配置格式为 “DOCKER”。

huangapple go评论56阅读模式
英文:

Error on gcloud artifact registry: INVALID_ARGUMENT: Maven config is not supported for format "DOCKER"

问题

我正在尝试使用gcloud artifact registry创建一个工件,我运行了gcloud init命令,一切正常,然后我运行了以下命令:

(venv) PS C:\Users\abc\Python VS code projects\project-name\server> gcloud artifacts repositories create repo-name --repository-format=docker --location=us-central1 --description="Docker repo description"

在这个过程中,我遇到了以下错误:

ERROR: (gcloud.artifacts.repositories.create) INVALID_ARGUMENT: Maven config is not supported for format "DOCKER"

我已经使用相同的gcloud命令列表一段时间来创建工件存储库,并在Google Cloud控制台上使用它们和许多其他API,但从未遇到过这个错误。我尝试过搜索,但没有结果。任何帮助将不胜感激。谢谢。还有我的Docker文件:


# 运行命令以安装所有依赖项
RUN pip install Flask gunicorn flask_wtf pyrebase4 firebase_admin httplib2==0.15.0 pycryptodome==3.10.1 
# RUN pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client

# 现在将我们的源代码复制到容器中的一个文件夹
COPY src/ app/
# 并将此容器文件夹设置为工作目录
WORKDIR /app
# 在这里设置一个端口的环境变量,该端口在app.py中的app.run命令中设置
ENV PORT 8080
# 运行gunicorn的命令,其中我们绑定端口,
# 将工作进程设置为1,
# 将线程设置为8,
# 绑定应用程序
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 app:app```


<details>
<summary>英文:</summary>

I am trying to create an artifact using gcloud artifact registry and I ran the ```gcloud init``` command which was fine and then I ran the following command

```(venv) PS C:\Users\abc\Python VS code projects\project-name\server&gt; gcloud artifacts repositories create repo-name --repository-format=docker --location=us-central1 --description=&quot;Docker repo description&quot;```

in doing so I came across the following error

```ERROR: (gcloud.artifacts.repositories.create) INVALID_ARGUMENT: Maven config is not supported for format &quot;DOCKER&quot;```

I have been using the same list of gcloud commands for creating artifact registries and using them and many other apis on google cloud console for some time but I have not come across this error. I have tried googling it but no avail. Any help would be appreciated. Thanks. Also my Docker file:

```FROM python:3.7

# run command to install all dependencies
RUN pip install Flask gunicorn flask_wtf pyrebase4 firebase_admin httplib2==0.15.0 pycryptodome==3.10.1 
# RUN pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client

# now to copy our sourcre code to a folder in the container
COPY src/ app/
# and set this container folder to working directory
WORKDIR /app
# here set environment variable for a port which we set in app.run command in app.py
ENV PORT 8080
# run a command for gunicorn where we bind the ports, 
# set workers to 1, 
# set threads to 8,
# bind the app 
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 app:app```

</details>


# 答案1
**得分**: 4

我在[这里的github链接][1]找到了解决方案。它没有说明问题的原因,但解决方案是更新gcloud组件。
我通过在管理员模式下运行以下命令来更新我的Cloud SDK CLI。

    gcloud components update


  [1]: https://github.com/google/app-reporting-pack

<details>
<summary>英文:</summary>

I found the solution to my problem [here on github][1]. It does not say what the reason for the problem was but the solution was to update gcloud components.
I updated my Cloud SDK CLI by running following command in administrator mode.

    gcloud components update


  [1]: https://github.com/google/app-reporting-pack

</details>



huangapple
  • 本文由 发表于 2023年6月2日 14:43:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76387734.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定