docker - 将 docker 镜像(不是 Dockerfile)部署到 Heroku?

标签 docker heroku

我想将现有的 Docker 镜像部署到 Heroku,但本地目录中没有 Dockerfile。 (我使用 datasette 创建了 Docker foo:bar 镜像,但我不知道它将 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

如何指定图像的名称?我认为the section on "Building and pushing images" in the documentation是我需要的,但我不明白“应用程序”和“进程类型”应该是什么。

更新:我尝试过:

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。我如何告诉它图像在哪里?

最佳答案

有用链接: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} 例如富/酒吧

可能的进程类型有 Web、Worker 和 Image。

在 docker Push 之后,您需要按照此运行 docker release 命令 link

heroku container:release web --app=my-app-12355 -- you don't require the '/' before the app name. That worked for me.

关于docker - 将 docker 镜像(不是 Dockerfile)部署到 Heroku?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50788725/

相关文章:

hadoop - kubernetes 中的多节点 Hadoop

linux - 状态错误 : no such file or directory while building Docker from a custom image with Docker build command

docker 错误 : . IOError:[Errno 13] 权限被拒绝: "./docker-compose.yml"

ruby - 将 HTML、CSS 和 Node.js/Ruby 与 Heroku、Git 和 AWS 放在一起

node.js - Axios 与 Heroku

ruby-on-rails - `initialize':postgres 方案不接受注册表部分:postgres:@(或错误的主机名?)(URI::InvalidURIError)与 Docker

docker - 无法创建 deno docker 镜像

ruby-on-rails - gzip压缩 Assets 和预编译 Assets 之间的Heroku冲突

ruby-on-rails - 推送到 Heroku 的 Ruby 应用程序显示问题

nginx - 在 heroku 上设置反向代理到 heroku 应用程序