Prevent volume creation on docker run
Dockerfile can contain
VOLUME /path instruction. That means that when
docker run is executed, docker creates automatically a volume and binds it to
/path inside container.
I’d like to skip the automatic volume creation in some cases. Is that possible somehow?
One Solution collect form web for “Prevent volume creation on docker run”
Not once it’s be added to the Dockerfile. I’d personally avoid doing volumes inside of the Dockerfile since it ends up creating anonymous volumes as you’ve seen, but also because it breaks attempts to modify that directory in child images or even later steps inside of the same Dockerfile.