Docker Mesos 参数

Docker arguments for Mesos

我正在尝试在 Mesos 集群中执行一个 docker 容器。我要执行的有效 docker 命令是:

docker run -it -v /home/me:/home/jovyan/work -p 8888:8888 jupyter/pyspark-notebook

我知道命令的形式是:

mesos-execute --containerizer=docker --master=127.0.0.1:9090 --name=test --docker_image=jupyter/pyspark-notebook --command="start-notebook.sh" --resources="cpus:8"

如何将 -p-v 参数的等价物传递给 memos-execute 命令?

目前,我是 运行 一个普通的 Mesos 集群,没有任何像 Marathon 这样的附加服务 运行。

来自mesos-execute

The value could be a JSON-formatted string of TaskInfo or a file path containing the JSON-formatted TaskInfo. Path must be of the form file:///path/to/file or /path/to/file.

See the TaskInfo message in mesos.proto for the expected format. NOTE: agent_id need not to be set.

TaskInfo 包含名为 ContainerInfo where you can configure port mappings 的容器配置文件。

对于任何其他自定义选项,您可以使用 Parameters

// Allowing arbitrary parameters to be passed to docker CLI.
// Note that anything passed to this field is not guaranteed
// to be supported moving forward, as we might move away from
// the docker CLI.
repeated Parameter parameters = 5;