简体   繁体   中英

Does Docker install and run dependencies only when I'm using it?

I have to develop for different programming languages, frameworks and DBMSs; sometimes with different versions of themselves or their dependencies. And I don't want to be with three or more services running all the time.

So I searched, and I found out about Vagrant, and then about Docker. I found Docker more interesting to me (at least, with the little knowledge I have about it), because Vagrant would require in some cases lot of RAM, and I don't think that the idea of running an virtual machine too much interesting.

My question is: will Docker install my dependencies locally, and run them only when I'm running the container? Because I tried to set up a Docker project using DevAssistant and it tried to install the RPMs (globally, I believe, although I'm not entirely sure about that).

You might want to do a little more reading into how docker images and containers are related. Docker images are things you typically built with all the dependencies bundled in. They take up disk space but not memory. When docker 'instantiates` an image it creates a container, which typically takes up memory but very little disk space due to the union filesystem. Those dependencies that you bundled in the image sort of get layered on top of the filesystem but they're still completely isolated within that container. They will not be globals. So to answer your question, in a sense yes, the dependencies are only running when you are running the container.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM