我想将现有的Docker映像部署到Heroku,在本地目录中没有Dockerfile。(我foo:bar使用数据集创建了Docker 映像,但我不知道它将Docker映像放在何处)。
这些是我可用的Docker映像:
$ docker images
REPOSITORY                                     TAG        IMAGE ID            CREATED             SIZE
foo                                            bar        d41xxxc69862        About an hour ago   1.08GB
<none>                                         <none>     af079eb9ceda        About an hour ago   980MB
我想将第一个docker映像(foo:bar)部署到Heroku。
我尝试过这样做heroku create my-app-12355,然后:
heroku container:push web -a my-app-12355
但这给了我:
  ?    No images to push
如何指定图像名称?我认为文档中有关“构建和推送图像”的部分是我所需要的,但我不知道应使用什么“ app”和“ process-type”。
更新:我尝试过:
docker tag d41xxxc69862 registry.heroku.com/my-app-12355/web
docker push registry.heroku.com/my-app-12355/web
但是当我这样做的时候heroku container:push web -a my-app-12355我仍然会得到No images to push。我如何知道图像在哪里?
小智 8
将docker镜像推送到 heroku 时,请确保您的Dockerfile以大写“D”命名。Heroku CLI 似乎没有将dockerfile(带有小写“D”)识别为搜索图像文件的可行名称,尽管 docker 本身可以。我用这个解决方案解决了这个问题。希望能帮助到你。
有用的链接:https : //toedter.com/2016/11/05/deploying-spring-boot-apps-to-heroku-using-docker/
我认为您需要先标记图像,然后将其推送到heroku注册表:
docker tag d41xxxc69862 registry.heroku.com/my-app-12355/web
docker push registry.heroku.com/my-app-12355/web
d41xx是图像ID。或者您可以尝试{image name} / {tag}例如foo / bar
可能的过程类型为Web,工作者和图像。
在docker push之后,您需要按照此链接运行docker release命令
heroku container:release web --app=/my-app-12355
| 归档时间: | 
 | 
| 查看次数: | 3145 次 | 
| 最近记录: |