I'm trying to parametrize the mounting of a drive in adocker container based on the UNC, USERNAME and PASSWORD used by docker-compose during the container creation/run process.
The password has some funky characters and seems to only partially injected (missing some letters at the end). I tried without using variables and with plan text and the result was the same.
Here is the code:
.env used to populate env variables in docker-compose
USERNAME=...
PASS=...
UNC=...
docker-compose.yml which creates the container and includes the env vars
service_name:
environment:
- USERNAME=${USERNAME}
- PASS=${PASS}
- UNC=${UNC}
mount.sh file which mounts the filesystem in the container using the passed env variables
mount -t cifs $UNC /dest_dir -o user=$USERNAME,password=$PASS --verbose
I've tried escaping every letter, escaping only the special characters, enclosing in single quotes. Pretty much everything I found here
Any ideas?