-
Is it possible to make an anonymous volume inside of a mounted volume? My use-case is that i want to setup a js development environment. My choice is to mount the project directory and do all the stuff inside it. Node would obviously create a "node_modules" folder inside the project directory, which I don't like leaking into my host environment. So far I thought I'd create an anonymous volume mounted at that "node_modules" path, but it doesn't seem to work. I do it like this (using Makefile): PWD = $(shell pwd)
DIR = $(shell basename $(PWD))
MNT = /opt/$(DIR)
IMG = node
sh:
podman run -v "$(PWD):$(MNT):z" -v "$(MNT)/node_modules" -p "9500:9500" -w $(MNT) -it $(IMG) bash So am I doing this right? Is it just not a viable way to use volumes? Maybe there's some other way to isolate node_modules that I don't know of? Please kindly provide your suggestions, if it wouldn't be terribly inconvenient. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
This should just work:
|
Beta Was this translation helpful? Give feedback.
Named or anonymous the directory will always exists on the host. It is just a bind mount from the podman volume directory into the container.