将Docker映像部署到heroku

时间:2020-05-22 16:32:27

标签: heroku docker-compose dockerfile docker-registry heroku-cli

enter image description here

enter image description here

我尝试通过以下命令将容器推送到Heroku:

sudo heroku container:push web --app <my-heroku-app>

但是我收到此错误“没有基本身份验证凭据”。

如何解决这个问题????

从登录到将docker映像推送到heroku都有所有步骤

  1. 第一个模式

1.1 enter image description here

1.2 enter image description here

1.3 enter image description here

1.4 enter image description here

1.5 enter image description here

  1. 第二种模式

2.1 enter image description here

2.2。 enter image description here

2.3。 enter image description here

整个模式遇到相同的问题,即“没有基本的身份验证凭据”

2 个答案:

答案 0 :(得分:7)

在推送之前登录Docker注册表

heroku container:login

答案 1 :(得分:2)

有两种登录注册表的方法,第一种是:

heroku container:login

但是对我有用的是以下方式:

docker login --username=<your username> --password=$(heroku auth:token) registry.heroku.com

See the docs