I have a simple docker-compose.yml file. I’d like to use the RESIN_MACHINE_NAME variable to define which docker image to pull. But I can’t seem to get it working. Here’s my config:
Hi, one note is that RESIN_MACHINE_NAME is not an environment variable, but a Dockerfile template variable, only available at the moment in Dockerfile.template files as %%RESIN_MACHINE_NAME%% (note, this is not the ${VARNAME} environment variable formatting), see more in the Dockerfile Templates docs.
We are planning to add support to template variables to docker-compose.yml, but the current workaround is the way that is shows in our getting started project:
You could basically create separate sidekick folder (or any other name) with just a Dockerfile.template of
FROM company/sidekick-resin:%%RESIN_MACHINE_NAME%%
(if that image has all your CMD and other setup as well). And in docker-compose.yml you’d use