jeroenpeeters / docker-ssh

SSH Server for Docker containers ~ Because every container should be accessible
GNU General Public License v2.0
638 stars 89 forks source link

Invalid interpolation format for environment option in Docker Compose #37

Closed asbjornu closed 6 years ago

asbjornu commented 6 years ago

Thanks for creating this Docker image. I'm trying to set it up with Docker Compose and have the following environment config for the container:

environment:
  - FILTERS={\"name\":[\"^/staging$\"]}
  - AUTH_MECHANISM=noAuth

However, when I try docker-compose up, it fails with the following error message:

ERROR: Invalid interpolation format for "environment" option in service "staging-ssh": "FILTERS={\"name\":[\"^/staging$\"]}"

Any idea what's up here? I also wonder whether the intricate filtering syntax is at all required in Docker Compose, where you can just reference other containers verbatim by name. Is there an alternative syntax or way to do this with Docker Compose?

asbjornu commented 6 years ago

I figured it out. The $ needs to be escaped by an extra $ as per the documentation. The correct syntax then becomes:

environment:
  - FILTERS={\"name\":[\"^/staging$$\"]}
  - AUTH_MECHANISM=noAuth