Docker volume plugin marathon

允我心安 提交于 2019-12-25 06:56:41

问题


Docker Volume plugins are released with Docker 1.8. I am trying to run a Docker container using Mesos/Marathon and I am able to run Docker container with volumes. What I am not able to do is connecting an external volume plugin.

As per marathon documentation any external parameter for Docker run can be passed as key value pair in the "parameter" tag of Marathon API POST.

The Docker container does come up but is not connecting to my plugin for volume. The JSON file is as below. I am using curl connecting to Marathon. Any help is appreciated.

curl -X POST http://A.B.C.D:8080/v2/apps -d @mygoserver.json -H "Content-type: application/json"


{
  "id": "basic1",
  "cmd": "/mygoserver",
  "cpus": 1,
  "mem": 2.0,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "mygoserver"
    },
    "parameters": [
                { "key": "volume-driver", "value": "testplugin" }
    ],
   "volumes": [
      {
        "containerPath": "/data",
        "hostPath": "mygoserver",
        "mode": "RW"
      }
    ]
  }
}

回答1:


As per Marathon doc, the parameters have to be specified as a child of docker, so in your case it would be:

"container": {
"type": "DOCKER",
"docker": {
  "image": "mygoserver"
  "parameters": [
    { "key": "volume-driver", "value": "testplugin" }
  ],
},

...



来源:https://stackoverflow.com/questions/32189172/docker-volume-plugin-marathon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!