Search code examples
dockerdocker-composedocker-machinedocker-container

How Docker containers solve No more works on my machine


I am learning docker and containers nowadays. So, I went through some videos and articles. But I could not find a strong answer for this question. When we run an applications on containers, how we are not getting the environment differentiation issue?. Could anyone explain this please?. Because we download an image to our machine and we run that image on our machine.


Solution

  • One avoids environment-related issue because container allows us to package code and its dependencies together into an isolated package. This model, thus also allows you to run multiple such isolated containers on the same host, resulting in better usage of hardware resources, and decreasing the impact of misbehaving applications on each other and their host system.

    Similar to a Java application, which will run exactly the same on any device capable of running a Java Virtual Machine, a Docker container is guaranteed to be identical on any system that can run Docker.