I mount a host file into a docker container, and the mounted file becomes a directory inside the container. That's how I run it:
$ docker run --name <containername> -it -d -v /home/core/account_config.py:/code/account_config.py <imagename> Inside the container:
# ls -la -rw-r--r--. 4 root root 0 Nov 6 10:25 __init__.py drwxr-xr-x. 2 root root 4096 Nov 6 10:59 account_config.py .... The file (in the host file system) is still a perfectly ok python file.
The source code is added into /code during build. The corresponding line in my Dockerfile is:
ADD ./code /code I want to be able to change the content of config file without rebuilding the image, so I want mount it later. What went wrong and how can I fix this?