Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"forcePullImage" param gets set to 'false'

Tags:

json

marathon

I am trying to build a docker image with Marathon, however when I use this configuration, the "forcePullImage" param gets set to 'false'

{
  "id": "name",
  "mem": 1024,
  "cpus": 0.5,
  "instances": 1,
  "container": {
    "type": "DOCKER",
        "volumes": [
      {
        "containerPath": "/etc/localtime",
        "hostPath": "/etc/localtime",
        "mode": "RO"
      }
    ],
    "docker": {
      "image": "dockerimage",
      "network": "BRIDGE",
      "portMappings": [ {
        "containerPort": 8080,
        "hostPort": 0,
        "servicePort": [PORTNUMBER],
        "protocol": "tcp",
        "name": "name"
      }],
      "parameters": [{ "key": "name", "value": "name" }]
    },
    "forcePullImage": true
  },
  "healthChecks": [
  {
    "path": "~/check/",
    "portIndex": 0,
    "protocol": "HTTP",
    "gracePeriodSeconds": 10,
    "intervalSeconds": 2,
    "timeoutSeconds": 10,
    "maxConsecutiveFailures": 10
  }],
  "labels":{
    "HAPROXY_GROUP":"external"
  }
}

When it is finally build in the marathon enviroment the config file gets set to this:

{
  "id": "name",
  "mem": 1024,
  "cpus": 0.5,
  "instances": 1,
  "container": {
    "type": "DOCKER",
        "volumes": [
      {
        "containerPath": "/etc/localtime",
        "hostPath": "/etc/localtime",
        "mode": "RO"
      }
    ],
    "docker": {
      "image": "dockerimage",
      "network": "BRIDGE",
      "portMappings": [ {
        "containerPort": 8080,
        "hostPort": 0,
        "servicePort": [PORTNUMBER],
        "protocol": "tcp",
        "name": "name"
      }],
      "parameters": [{ "key": "name", "value": "name" }]
    },
    "forcePullImage": false
  },
  "healthChecks": [
  {
    "path": "~/check/",
    "portIndex": 0,
    "protocol": "HTTP",
    "gracePeriodSeconds": 10,
    "intervalSeconds": 2,
    "timeoutSeconds": 10,
    "maxConsecutiveFailures": 10
  }],
  "labels":{
    "HAPROXY_GROUP":"external"
  }
}

After it is build I have to manually change the 'false' param to 'true' and after that it actually works, but why is it getting set to false when adding it to marathon and how can I fix this problem?

like image 986
Mees Kluivers Avatar asked Apr 19 '26 18:04

Mees Kluivers


1 Answers

The Marathon app spec you posted is in fact invalid. If you look at the schema you see that forcePullImage has to be a child of the docker field (not the container field as in your example). The correct usage would be:

"docker": {
  "image": "dockerimage",
  "forcePullImage": false,
  ...
}
like image 78
Michael Hausenblas Avatar answered Apr 21 '26 17:04

Michael Hausenblas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!