Skip to content

Instantly share code, notes, and snippets.

@piksel
Last active February 18, 2022 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piksel/2ea95bb046e4d8f7c5b18f3ad150b201 to your computer and use it in GitHub Desktop.
Save piksel/2ea95bb046e4d8f7c5b18f3ad150b201 to your computer and use it in GitHub Desktop.
Dockr Desktop haunted binding mount

Docker, run this container with my file mounted.

❯ docker run --rm -it -v /src/app/nginx/mime.types:/etc/nginx/mime.types nginx:latest ls /etc/nginx/
docker: Error response from daemon: not a directory.
See 'docker run --help'.

Eh, thanks I guess?

❯ ls -lha /src/app/nginx/mime.types
-rw-rw-r-- 1 nils nils 5.2K Feb 14 11:10 /src/app/nginx/mime.types

Well, you are not wrong...

Let's make a copy of the file with another name...

❯ cp /src/app/nginx/mime.types /src/app/nginx/mime.types2

Docker, run this container with the new copy of my file mounted.

❯ docker run --rm -it -v /src/app/nginx/mime.types2:/etc/nginx/mime.types nginx:latest ls /etc/nginx/
conf.d  fastcgi_params  mime.types  modules  nginx.conf  scgi_params  uwsgi_params
#

...right.

👻🐋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment