dcos / dcos-cli

The command line for DC/OS.
https://docs.d2iq.com/mesosphere/dcos/latest/cli/
Apache License 2.0
224 stars 118 forks source link

How can I update a Marathon app Docker image? #978

Closed Darkhogg closed 5 years ago

Darkhogg commented 7 years ago

dcoscli.version=0.4.16 dcos.version=1.9.0 dcos.commit=0ce03387884523f02624d3fb56c7fbe2e06e181b dcos.bootstrap-id=58fd0833ce81b6244fc73bf65b5deb43217b0bd7

Ubuntu 16.04

I've tried every variation I've come up with to try and update the container.docker.image parameter, and nothing else, using dcos marathon app update: Specifying the path as container.docker.image, container/docker/image and /container/docker/image; passing as value an object with {"docker":{"image":"..."}}, etc.

I can't seem to be able to update it in any way, what am I doing wrong? What should I do instead? Thank you.

tamarrow-zz commented 7 years ago

Please post this against Marathon: https://jira.mesosphere.com/projects/MARATHON/issues/MARATHON-7261?filter=allopenissues

Darkhogg commented 7 years ago

I will, but... which of my attemps should have been successful, if any?

tamarrow-zz commented 7 years ago

It's not super clear from your post what exactly you ran and what your app definition looks like, but this example should help:

$ cat cli/tests/data/marathon/apps/zero_instance_sleep.json
{
  "id": "zero-instance-app",
  "cmd": "sleep 1000",
  "cpus": 0.1,
  "mem": 16,
  "instances": 0,
  "dependencies": ["/product/database", "../backend"],
  "labels": {
    "PACKAGE_ID": "zero-instance-app",
    "PACKAGE_VERSION": "1.2.3"
  }
}

$ dcos marathon app add cli/tests/data/marathon/apps/zero_instance_sleep.json
Created deployment 533751c4-c37c-442d-89ec-7cca571e3dfa

$ dcos marathon app update zero-instance-app < cli/tests/data/marathon/apps/update_zero_instance_sleep.json
Created deployment de113567-343a-4528-8560-e543e4279578

$ dcos marathon app update zero-instance-app mem=2
Created deployment b35ef6fe-8832-4ca6-b72a-4f325c1a9682

The files referenced are all in this repo.

Darkhogg commented 7 years ago

Do I have to provide the whole JSON just to modify the Docker image in use? Piping is probably the only thing I didn't try, I assumed it would work the same as editing fields. Let me check if it works...

deenaik commented 6 years ago

The related dcos-cli command is dcos marathon app restart [--force] Restarting the app assumes that you are overwriting the tag in use for your docker image and that forcePullImage is set to true.