Best practices for Volume Management with catalogs?

I’m building some catalog entries to enable me to quickly spin up containers I’m able to quickly reconfigure using the Rancher catalog UI. I’m having a hard time with volume configuration via rancher-config questions functionality. E,G,:

for example. In my rancher-compose:
- variable: path-config
label: "Path to configuration"
description: "Maps /config inside the container"
default: /opt/appdata/sonarr
type: string
required: true
and in my docker-compose:
volumes:
- ${path-config} :/config

Attempting to spin up this container yields the following error:
Error (Invalid interpolation format for key “volumes”: “${path-config} :/config”)

What’s the best way to accomplish this? The volumes will be bind mounted in several containers for functionality, they’re all on the same host to keep things simple, Apparently data containers aren’t cool anymore, and my approach is the advised way from the lords of Docker. So how is this accomplished - some Googling showed up some old docs where you have to run a shell script to set up the variables prior to running docker-compose. I guess I thought that rancher-compose was doing some magic there of a similar nature?

Variable replacement is not supported there.

Generally you want Stack-scoped named volumes for catalog items so that each instance of the catalog template gets it’s own storage. If you actually want them all using the same volume you can do Environment-scoped.

1 Like