将Docker映像(不是Dockerfile)部署到Heroku? [英] Deploy docker image (not Dockerfile) to Heroku?
问题描述
我想将现有的Docker映像部署到Heroku,在本地目录中没有Dockerfile。 (我使用数据集创建了Docker foo:bar
映像,但我不知道它将Docker映像放置在什么位置。)
I want to deploy an existing Docker image to Heroku, where there is no Dockerfile in the local directory. (I created the Docker foo:bar
image using datasette, and I don't know where it puts the Docker image).
这些是我可用的Docker映像:
These are the Docker images I have available:
$ 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。
I want to deploy the first docker image (foo:bar
) to Heroku.
我尝试做 heroku创建my-app-12355
,然后:
heroku container:push web -a my-app-12355
但是这给了我
▸ No images to push
如何指定图像名称?我认为文档中有关构建和推送图像的部分是我需要的,但是我不知道应该是什么 app和 process-type。
How do I specify the name of the image? I think the section on "Building and pushing images" in the documentation is what I need, but I don't understand what "app" and "process-type" should be.
更新:我尝试过:
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
我仍然得到没有要推送的图片
。我怎么知道图像在哪里?
But when I do heroku container:push web -a my-app-12355
I still get No images to push
. How do I tell it where the image is?
推荐答案
有用的链接: https://toedter.com/2016/11/05/deploying-spring-boot- apps-to-heroku-using-docker /
我认为您需要先标记图像,然后将其推送到heroku注册表:
I think you need to first tag your image and then push it to heroku registry:
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
d41xx is image id. Or you can try {image name}/{tag} e.g. foo/bar
可能的进程类型是Web,工作者和映像。
Possible process-types are web, worker and image.
在docker push之后,您需要按照链接
After docker push you need to run docker release command as per this link
heroku container:release web --app=my-app-12355 -- you don't require the '/' before the app name. That worked for me.
这篇关于将Docker映像(不是Dockerfile)部署到Heroku?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!