form-pack | tiny vanilla javascript library for serialize form | JSON Processing library
kandi X-RAY | form-pack Summary
kandi X-RAY | form-pack Summary
The tiny vanilla javascript library for serialize form-data to JSON or URL encoded.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of form-pack
form-pack Key Features
form-pack Examples and Code Snippets
Community Discussions
Trending Discussions on form-pack
QUESTION
I'm trying to create a relatively simple setup to develop and test npm packages. A problem was in the fact, that after you mounted a code volume to the container it replaces node_modules.
I tried a lot of generally logical stuff, mostly aimed to move node_modules to another location and then reference it within configuration files. It works, but the solution is ugly. Also, it's not good practice to install webpack globally, but my solution requires it.
However, after some time I found this solution, which looks elegant, just what I needed, but it also has one problem. I don't understand completely, how it works.
That my version of how everything operates.
Docker reorders volume mounting based on container paths
Docker mounts sub dir volume at first
Docker mounts parent dir volume but due to an unexplained mechanism, it does not override the sub dir volume...
???
PROFIT. node_modules dir is in place and webpack runs perfectly.
So, I really want to understand how it actually does all of this black magic. Because without this knowledge I feel like I'm missing something important.
So, guys, how it works?
Thanks in advance.
ANSWER
Answered 2019-Mar-26 at 00:01The Docker daemon, when it creates the container, sorts all of the mount points to avoid shadowing. (On non-Windows, this happens in (*github.com/docker/docker/daemon.Daemon).setupMounts
.) So, in your example:
- The Docker daemon sees that both
/package
and/package/node_modules
contain data that's stored outside the container filespace. - It sorts these shortest to longest.
- It mounts
/package
, as a bind-mount to the named host directory. (First, because it's a shorter path name.) - It mounts
/package/node_modules
, shadowing the equivalent directory in the previous mount, probably as a bind-mount to a directory with long hex identifier name somewhere in/var/lib/docker/volumes
.
You can experiment more with this with a docker-compose.yml
file like
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install form-pack
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page