我想将现有的 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/