Is there a way to set a variable from a file in the docker compose?
The following does not work in compose (however it does if you attach to the container):
version: '2'
services:
foo:
image: busybox
command:
- /bin/sh
- -c
- |
echo "hello" > id #this file will be supplied by a volume-from
ls
cat id
TEST=$(cat id) #This line does not work
echo TEST
The error which is produced is:
ERROR: Invalid interpolation format for "command" option in service "foo":