Sometimes, though, one does not have time to write a Dockerfile. For ad-hoc testing one sometimes would like to just get a bash prompt in a container. This can be done like so:
$ docker run -i -t opensuse bash
But this has the disadvantage (or advantage, depending on point of view) that the local filesystem is inaccessible. Docker gives the container a completely fresh filesystem to work in. What if we just want to give the container read/write access to the current working directory?
The magic incantation for that is:
docker run -v $(pwd):$(pwd) -w $(pwd) -i -t opensuse bash
Since that's unfit for storage in failing human memory, I'll put it here :-)
No comments:
Post a Comment