I am converting docker containers into Custom Apps of TrueNAS 25.04 managing them in the WebUI. It should prevent iX from messing them unnoticeably.
A Custom App can be created from filling in the content of compose.yaml in the WebUI. I have no control about the environment variables it may load nor the directory the compose.yaml runs from. Hence I need some variables for saving me from repeating the required directories and files in the “compose.yaml” field. It helps me to deploy them onto various machines as well.
Here is my question: Is there a way to concatenate alias in a docker compose file?
For example, a docker compose file as following:
services:
glances:
image: nicolargo/glances:latest
container_name: glances
pid: host
network_mode: host
environment:
- "TZ=Europe/London"
- "GLANCES_OPT=-C /config/glances.conf -w"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /docker/glances/config:/config:ro
- /docker/glances/data:/data:ro
restart: unless-stopped
I would like to convert it to something as the following:
x-var: &home /docker/glances
services:
glances:
image: nicolargo/glances:latest
container_name: glances
pid: host
network_mode: host
environment:
- "TZ=Europe/London"
- "GLANCES_OPT=-C /config/glances.conf -w"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- !join [*home, "/config:/config:ro"]
- !join [*home, "/data:/data:ro"]
restart: unless-stopped
Is it possible?
*homemean? The first example doesn’t containhome, so I’m not sure to understand the goal here.