Open Nelrann opened 2 years ago
What version of Docker compose are you having this issue with, I suspect <v2.x?
I cannot replicate this with Docker 20.10.21 and Docker compose 2.14.0.
Can you please try upgrade and retest?
I've ran in this issue before. `You may need to escape any $ with another $' In your case that would be from "$2a$14$1l.IozJx7xQRVmlkEQ32OeEEfP5mRxTpbDTCTcXRqn19gXD8YK1pO". to "$$2a$$14$$1l.IozJx7xQRVmlkEQ32OeEEfP5mRxTpbDTCTcXRqn19gXD8YK1pO".
After that docker compose worked for me
I am still getting this error :(.
ubuntu@ip-172-31-33-157:~/dockprom$ ADMIN_USER='admin' ADMIN_PASSWORD='admin' ADMIN_PASSWORD_HASH="$$2a$$14$$1l.IozJx7xQRVmlkEQ32OeEEfP5mRxTpbDTCTcXRqn19gXD8YK1pO" docker compose up -d
invalid interpolation format for services.caddy.environment.[]: "$2a$14$1l.IozJx7xQRVmlkEQ32OeEEfP5mRxTpbDTCTcXRqn19gXD8YK1pO". You may need to escape any $ with another $
In your docker-compose.yaml
, manually hand edit the environmental variable like so:
environment:
- ADMIN_USER=${ADMIN_USER:-admin}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- ADMIN_PASSWORD_HASH=${ADMIN_PASSWORD_HASH:-$$2a$$14$$1l.IozJx7xQRVmlkEQ32OeEEfP5mRxTpbDTCTcXRqn19gXD8YK1pO}
Having same issue with Docker compose V2.23.0, but shouldn't a PR be raised to add the escaping of the $ in the hash, or does it only affect those using V2.x of compose?
I am still getting this error :(.
ubuntu@ip-172-31-33-157:~/dockprom$ ADMIN_USER='admin' ADMIN_PASSWORD='admin' ADMIN_PASSWORD_HASH="$$2a$$14$$1l.IozJx7xQRVmlkEQ32OeEEfP5mRxTpbDTCTcXRqn19gXD8YK1pO" docker compose up -d invalid interpolation format for services.caddy.environment.[]: "$2a$14$1l.IozJx7xQRVmlkEQ32OeEEfP5mRxTpbDTCTcXRqn19gXD8YK1pO". You may need to escape any $ with another $
I'm not really sure why this doesn't work because it looks like you're escaping with double quotes properly, it might have something to do with your shell and its interpolation. You could try using single quotes instead and removing the escaping of $ with another $ like below.
ADMIN_USER='admin' ADMIN_PASSWORD='admin' ADMIN_PASSWORD_HASH="$$2a$$14$$1l.IozJx7xQRVmlkEQ32OeEEfP5mRxTpbDTCTcXRqn19gXD8YK1pO" docker compose up -d
Can become:
ADMIN_USER='admin' ADMIN_PASSWORD='admin' ADMIN_PASSWORD_HASH='$2a$14$1l.IozJx7xQRVmlkEQ32OeEEfP5mRxTpbDTCTcXRqn19gXD8YK1pO' docker compose up -d
You only need to escape $ with another $ if utilising double quotes "
.
The default in the docker-compose
works without any issues, you can test this by cloning a fresh repository and attempting a docker-compose up -d
.
Either replace the defaults in the compose file with your actual hashes or utilise the appropriate quoting/escaping when prepending the docker compose up -d
command.
Error when a try to clone and start project
invalid interpolation format for services.caddy.environment.[]: "$2a$14$1l.IozJx7xQRVmlkEQ32OeEEfP5mRxTpbDTCTcXRqn19gXD8YK1pO". You may need to escape any $ with another $.