Uploaded image for project: 'Marathon'
  1. Marathon
  2. MARATHON-3341

'--rm' arbitrary option to 'docker run' is ignored

    Details

    • Type: Task
    • Status: Resolved
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      I'm trying to pass an arbitrary rm option to docker run command via Marathon's API. The expected behavior would be to delete the container when the Marathon's APP is removed. However, it looks like this one specific parameter is ignored. When I delete Marathon's APP the container is stopped but it's not deleted (docker ps -a still shows the instance which is in Exited state). This is the body of a POST request to create an instance:

      {
        "id": "plugin-test",
        "mem": 1024,
        "instances": 1,
        "args": [
            "bash",
            "-c",
            "sleep 3600"
        ],
        "container": {
          "type": "DOCKER",
          "docker": {
            "image": "ubuntu",
            "network": "BRIDGE",
            "privileged": true,
            "parameters": [
              { "key": "label", "value": "mylabel1" },
              { "key": "rm", "value": "true" },
              { "key": "volume-driver", "value": "rbd"},
              { "key": "volume", "value": "foo:/mnt/foo" }
            ]
          }
        }
      }
      

      The problem I have is that I want the instance to be removed entirely so that the Docker volume plugin I use can automatically cleanup the created RBD images. You can see that apart from rm option I also pass label, volume-driver and volume which are parsed correctly (I can see that the label was set and that the volume plugin was triggered as expected).

      Tested with Docker 1.9.1 and Marathon 0.11.1.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              GitHub_mateusz-blaszkowski Mateusz Blaszkowski (Inactive)
              Team:
              Orchestration Team
              Watchers:
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: