We run into a strange error when we added a new environment variable to our Docker Compose file:
ERROR: Invalid interpolation format for “environment” option in service “api”: “MY_KEY=Abc$5” Our docker-compose.yaml file looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
version: "3.2" services: db: image: mcr.microsoft.com/mssql/server:latest volumes: - ./container_db:/var/opt/mssql/data environment: ACCEPT_EULA: Y SA_PASSWORD: P@ssword123 ports: - 6000:1433 api: image: mcr.microsoft.com/dotnet/sdk:6.0 volumes: - ./MinApi:/workspace working_dir: /workspace command: sh -c 'while true; do sleep 30; done' environment: - MY_KEY=Abc$5 ports: - 7001:7000 depends_on: - db |
The problem is the $ in the value of the environment variable MY_KEY. Docker allows a lot of …
Read more