I need to read a bunch of environmental variables from a text file which exists in a docker image at address (/service/variables.txt) and set them as environmental variables in my running container and then execute a command which utilized them. I'm doing these steps in a docker-compose file as follows. I'd like my docker-compose to look like something like below.
services:
service1:
image: imagename:tag
container_name: name
command:
- exec source /service/variables.txt
- exec export $(cut -d= -f1 /service/variables.txt)
- exec start_service $VAR1 $VAR2
My question is how can I have multiple exec
command under command
in a docker-file?