I'm trying to pass a file to a docker container using the VOLUME instruction but cannot find a way to do it properly.
Right now I have the instruction inside my Dockerfile as:
...
VOLUME ~/.aws/credentials /home/app/.aws/credentials
...
, but it seems as docker instead of mounting the file creates an empty folder named credentials inside an .aws folder.
I also tried mounting it with:
VOLUME ~/.aws/credentials:/home/app/.aws/credentials
, but this actually does nothing. It doesn't even create the .aws folder.
I'm trying to do it that way so I don't have to add the -v flag when doing docker run.
From the documentation I could not find any valid way to do it that way. Does anyone have any proper solution to such case?