On this page https://mherman.org/blog/dockerizing-an-angular-app/ ,
At some point in this tutorial there is this command to launch the container:
$ docker run -v ${PWD}:/app -v /app/node_modules -p 4201:4200 --rm example:dev
.
I don't understand the -v /app/node_modules
part. What is the purpose of -v
when there are no source and destination split by a colon mark?
I've been reading official documentation:
- https://docs.docker.com/engine/reference/commandline/run/#mount-volume--v---read-only ;
- https://docs.docker.com/storage/bind-mounts/ ;
- and https://docs.docker.com/storage/volumes/ .
I don't see an example and explanation about docker run -v [some absolute path directory by itself] [container image name]
.
I understand the behaviour of:
docker run -v [the source, an absolute path on the host to map to a destination within the container]:[the destination, an absolute path in the container] [container image name]
;- and
docker run -v [the source, a docker volume name to map to a destination within the container]:[the destination, an absolute path in the container] [container image name]
.
But I don't get what is the expected behaviour of that: docker run -v [some absolute path directory by itself] [container image name]
.
What is -v [some absolute path directory by itself]
, like -v /app/node_modules
; how does it articulate between the host and the container?