简体   繁体   中英

Editing docker volume data on host not changing inside container?

I am making application in docker environment. (toolbox) I work on the local PC by sharing the volumn. When editing a js file, it can not be modified on the website. However, I can change the js file to vi in the docker container.

Cache does not seem to be the cause. What is the cause ???

Don't edit from outside the container. It is the limitation of mount.

If you are using some editor like vim, when you save the file it does not save the file directly, rather it creates a new file and copies it into place. This breaks the bind-mount, which is based on inode. Since saving the file effectively changes the inode, changes will not propagate into the container. When the container is restarted the new inode. If you edit the file in place you should see changes propagate.

This is a known limitation of file-mounts and is not fixable.

taken from github comment

Known Issue on github

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM