Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Heroku:部署minio服务器时Dockerfile CMD失败_Docker_Heroku_Dockerfile_Minio - Fatal编程技术网

Heroku:部署minio服务器时Dockerfile CMD失败

Heroku:部署minio服务器时Dockerfile CMD失败,docker,heroku,dockerfile,minio,Docker,Heroku,Dockerfile,Minio,我正在尝试将我的minio服务器部署到heroku。这是我的Dockerfile: FROM minio/minio ENV MINIO_ACCESS_KEY="xxxxxx" ENV MINIO_SECRET_KEY="xxxxxxxx" CMD ["server", "/data"] EXPOSE 9000 当我通过docker构建并运行它(使用以下命令:)时,它在本地工作 Dockerfile是目录中唯一的文件 然后,我试着把它推给heroku。我按照上的命令安装heroku容器插件、登

我正在尝试将我的minio服务器部署到heroku。这是我的Dockerfile:

FROM minio/minio
ENV MINIO_ACCESS_KEY="xxxxxx"
ENV MINIO_SECRET_KEY="xxxxxxxx"
CMD ["server", "/data"]
EXPOSE 9000
当我通过docker构建并运行它(使用以下命令:)时,它在本地工作

Dockerfile是目录中唯一的文件

然后,我试着把它推给heroku。我按照上的命令安装heroku容器插件、登录等。然后,我使用以下命令推送我的应用程序:
heroku容器:推送web--app app_NAME

当我访问应用程序时,浏览器中出现应用程序错误。这是heroku日志显示的内容:

2017-09-21T02:24:47.589576+00:00 app[api]: Deployed web (26b84915ed48) by user []
2017-09-21T02:24:47.589576+00:00 app[api]: Release v28 created by user []
2017-09-21T02:24:48.241050+00:00 heroku[web.1]: State changed from crashed to starting
2017-09-21T02:24:49.480733+00:00 heroku[web.1]: Starting process with command `server /data`
2017-09-21T02:24:51.961825+00:00 app[web.1]: ‘server /data’ is not a minio sub-command. See ‘minio --help’.
2017-09-21T02:24:52.056706+00:00 heroku[web.1]: Process exited with status 1
2017-09-21T02:24:52.064400+00:00 heroku[web.1]: State changed from starting to crashed
2017-09-21T02:24:52.938136+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=APP_NAME.herokuapp.com request_id=80ddd6f8-c053-4ff6-b4c9-fdb0ce8a48a5 fwd="67.245.14.153" dyno= connect= service= status=503 bytes= protocol=https
2017-09-21T02:24:54.319660+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=APP_NAME.herokuapp.com request_id=9988b6af-8a91-4e77-9bd4-c79c9e2ec24c fwd="67.245.14.153" dyno= connect= service= status=503 bytes= protocol=https
对于那些不熟悉minio的人来说,
'server/data'的一些解释不是minio子命令。请参阅“minio--help”。
:当您使用非minio命令的参数运行minio命令时,将显示此信息。比如说,

./minio sadf
‘sadf’ is not a minio sub-command. See ‘minio --help’.
所以heroku告诉我的是,它在解释Dockerfile中的CMD行,而不是它应该解释的内容(它使用
server
作为minio子命令,
/data
作为参数),但是如果你注意到引号,heroku正在将这两部分组合在一起,并试图将整个字符串用作minio子命令-因此出现了错误消息。它正在尝试运行命令
minio'server/data'
而不是
minio server/data


以前有没有人见过heroku在Dockerfile上的这种行为?如何确保CMD行被正确解释,而不是作为一个完整字符串?我认为这是一个heroku问题,因为它在本地运行良好。欢迎提供任何建议

我有一个类似的问题,似乎是由于父层中有其他入口点引起的。为了解决这个问题,我在我的CMD上面添加了
ENTRYPOINT[]
,一切都很好。

推一个简单的图像,尝试在一个基本的阿尔卑斯山图像上测试不同的CMD,看看是否真的是这样
./minio sadf
‘sadf’ is not a minio sub-command. See ‘minio --help’.