我想要将现有的Docker镜像部署到Heroku,在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。我如何告诉它图像在哪里?
发布于 2018-06-11 07:15:54
有用链接: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/webd41xx是镜像id。或者您可以尝试{image name}/{tag},例如foo/bar
可能的进程类型有web、worker和image。
docker推送后,您需要根据该link执行docker release命令
heroku container:release web --app=my-app-12355 -- you don't require the '/' before the app name. That worked for me.发布于 2020-06-26 02:15:10
在向heroku推送docker镜像时,请确保您的docker文件的名称为大写"D“。Heroku CLI似乎没有将 docker文件(小写为"D")识别为搜索图像文件的可行名称,尽管docker本身可以。我用这个解决方案修复了这个问题。希望能有所帮助。
发布于 2019-11-14 03:16:41
heroku container:push image_name -a=app_namehttps://stackoverflow.com/questions/50788725
复制相似问题