Encrypted Password in docker-compose file
I created a encrypted password according to the documentation
echo -n "your-password" | docker run -i --rm atmoz/makepasswd --crypt-md5 --clearfrom=-
But I cannot seem to get the ecrypted password to work for my docker-compose file:
version: "2.2"
services:
app:
image: atmoz/sftp
volumes:
- /home/user/Documents/upload:/home/user/upload/
- ./permissionfix.sh:/etc/sftp.d/permissionfix.sh
ports:
- "127.0.0.1:2222:22"
command: user:encryptedpassword:e:1001
container_name: sftp
I end up getting an error
ERROR: Invalid interpolation format for "command" option in service "app": "user:encryptedpassword:e:1001"
Any one have a fix to this issue, you can assume my encrypted password starts with the dollar sign ($) and has a long alphanumeric I just did not want to broadcast it even though this is just a test environment.
You have to use double dollar-signs so that compose does not interpret the string as a variable.
https://docs.docker.com/compose/compose-file/compose-file-v3/#variable-substitution