Heroku从现有的Docker映像部署

时间:2019-04-26 17:02:48

标签: docker heroku

我正在尝试使用现有的Docker映像在Heroku上部署GitHub机器人。

图像已构建。我已尝试将其部署到Heroku:

$ heroku login
Logging in... done
Logged in as EMAIL
$ heroku container:login
Login Succeeded
$ docker tag IMG_ID registry.heroku.com/APP/web
$ docker push registry.heroku.com/APP/web
The push refers to repository [registry.heroku.com/APP/web]
ABC: Layer already exists 
XYZ: Layer already exists 
...
lastest: digest: sha256:NUMBER size: SIZE
$ heroku container:release registry.heroku.com/APP/web
Expected response to be successful, got 404

并且没有完成发布。

我已根据https://devcenter.heroku.com/articles/container-registry-and-runtime#release-phaseDeploy Existing Docker Image To Heroku进行了这些操作,但似乎对我没有用。

在这一点上,我还很困,不胜感激。

编辑:

Docker pull:

$ docker pull registry.heroku.com/APP/web
Using default tag: latest
latest: Pulling from APP/web
Digest: sha256:NUMBER
Status: Image is up to date for registry.heroku.com/APP/web:latest

Heroku运行:

$ heroku run bash --type=web
Running bash on ⬢ APP... up, web.1514 (Free)

1 个答案:

答案 0 :(得分:0)

我认为您的释放命令格式错误:您不应该指定完整的图像标签,而只能指定dyno类型。

对我有用的是 mydb = mysql.connector.connect(host="localhost", user="root", password="afif123", db="library") mycursor = mydb.cursor() fill = '''UPDATE issued_book SET Today = current_date()''' mycursor.execute(fill) #or today = datetime.datetime.now() fill = '''UPDATE issued_book SET Today = %s''' mycursor.execute(fill, [today])

您似乎无法直接指定图片版本/标签; heroku container:release web -a <app>始终带有container:release标签。