nahiluhmot
Joined 13 years ago
Joined 13 years ago
Where would we be if we supported all legacy software? Does there not come a point where cutting support for a class of platforms is a good thing? This article makes some good points, and I think a lot of frontenders (myself included) would benefit from being a bit more "boring", but this article is going a little too far the other way.
docker run -v /tmp/:/host-tmp/ ubuntu:14.04 bash -lc "echo 'TEST123' > /host-tmp/test"
Should create a file on your host's filesystem called "/tmp/test" with the text "TEST123".This is actually not the case. Although containers do not share any persistent volumes with the host by default, you can use the --volume option[0] to do so.
To answer your question, I've used Docker for local development to run MySQL, Postgres, and Redis inside of containers. Using the aforementioned --volume option, you can share the unix socket opened by either of these services from the container to the host. Otherwise, you can use the --port option[1] to share ports between the container and the host.
I've had a generally pleasant experience using Docker for this use case and would recommend it. It's nice being able to start using a new service by pulling and running an image. Similarly, it's nice to have the ability to clear the state by removing the container, assuming you choose not to mount volumes between the container and the host.
The only frustration I've run into is running out of disk because I have too many images, but it takes a while to get to that point and those can easily be deleted.
[0] https://docs.docker.com/reference/run/#volume-shared-filesys... [1] https://docs.docker.com/reference/run/#expose-incoming-ports