Rancher-compose: howto upgrade only primary (not sidekicks)

Hi, I have the following situation:

  • Primary container (using volumes from sidekick)
  • Sidekick container, start once (only supplies data volumes to primary)

From the UI I can upgrade only the primary and reuse the volumes from the sidekick. I have been trying to achieve the same using rancher-compose. But can not get it to work.

I have made a rancher-compose file only specifying the primary service and volumes_from “sidekick”. But when I run this through rancher-compose I always get an upgraded primary with new volumes instead of the volumes from the “sidekick”.
The Dockerfile for the primary also specifies volumes at the same mount point so I assume this is used and the volumes_from is completely ignored.

Here are the files I use

Create rancher-compose file

version: '2'
services:
    data:
        container_name: data
        image: tianon/true
        volumes:
            - /var/data
        labels:
            io.rancher.container.start_once: true
    server:
        extends:
            file: server.yml
            service: server
        volumes_from:
            - data
        labels:
            io.rancher.sidekicks: data

Upgrade rancher-compose file

version: '2'
services:
    server:
        extends:
            file: server.yml
            service: server
        volumes_from:
            - data

Any help is appreciated,
Jeroen

Ok already found the solution. So simple :slight_smile:
Just specify the specific services you wish to upgrade. In this case only specify the “server” service.

In my case this:
rancher-compose -p stack up -d --force-upgrade --pull server