给定一个容器运行的dyno,Heroku相当于docker exec -it blarg /bin/bash
什么?也就是说,如何在已经运行的容器中打开shell?
示例Dockerfile:
FROM heroku/heroku:16
CMD while true; do sleep 1; done
Run Code Online (Sandbox Code Playgroud)
示例运行:
$ heroku container:push my_app
<wait a minute>
$ heroku ps
=== my_app (Free): /bin/sh -c while\ true\;\ do\ sleep\ 1\;\ done (1)
my_app.1: up 2017/10/09 12:13:07 -0600 (~ 4m ago)
Run Code Online (Sandbox Code Playgroud)
到现在为止还挺好.
但现在...
$ heroku ps:exec --dyno=my_app.1
Establishing credentials... error
? Could not connect to dyno!
? Check if the dyno is running with `heroku ps'
Run Code Online (Sandbox Code Playgroud)
为了更好的衡量,我heroku ps
在这一点检查,它表明dyno仍然在运行.
是的,我已经完成了Heroku建议启用Docker支持的所有功能.每文档,我已经用我选择的基本图像,同时确保试过 …