Using rancher-cli to do upgrades without dealing with docker-compose.yml

I’ve been looking into the new rancher-cli docs http://docs.rancher.com/rancher/v1.2/en/cli/ and can’t seem to find a way to upgrade a Service image without involving docker-compose.yml.

This is quite an important feature, for example in a CI/CD pipeline I want to the following simple steps:

  1. Build a new docker image for Service A with tag: v10
  2. Upgrade Service A to use v10
  3. Finish the Upgrade

I can’t use rancher up because that means I need to modify a docker-compose.yml, which I don’t want to do since my Continuous Deployment pipeline is triggered by a code modification.

It just seem very restrictive having to deal with a massive docker-compose.yml for a one line image version or environment variable upgrade. I avoided rancher-compose for this very reason and resorted to using the Rancher REST API (see Upgrade Rancher Service using REST API) but now the rancher-cli seem to be working exactly the same way as docker-compose on this issue.

The best alternative I found was actually this: https://github.com/etlweather/gaucho which allows you to run ./services.py upgrade --imageUuid=imageName:tag --autoComplete. Is it possible to incorporate some of these features into rancher-cli?

3 Likes

There’s currently a feature request for this.

Thanks will watch that.

I have prefered another approach relying on multi tagging images.
I create a stack with my service A and tag :dev
In my repository I pushed my image A with tag v1.0 and dev

If I push a new version v1.1 and I’d like to use it in my stack, I just add the tag “dev” to the v1.1 and launch a rancher up with my config file which is always the same (A:dev never change in docker-compose.yaml)

Tags are moving and docker-compose.yaml not.