How is Docker different from a virtual machine?

前端 未结 20 2645
闹比i
闹比i 2020-11-21 22:36

I keep rereading the Docker documentation to try to understand the difference between Docker and a full VM. How does it manage to provide a full filesystem, isolated network

相关标签:
20条回答
  • 2020-11-21 23:41

    In relation to:-

    "Why is deploying software to a docker image easier than simply deploying to a consistent production environment ?"

    Most software is deployed to many environments, typically a minimum of three of the following:

    1. Individual developer PC(s)
    2. Shared developer environment
    3. Individual tester PC(s)
    4. Shared test environment
    5. QA environment
    6. UAT environment
    7. Load / performance testing
    8. Live staging
    9. Production
    10. Archive

    There are also the following factors to consider:

    • Developers, and indeed testers, will all have either subtlely or vastly different PC configurations, by the very nature of the job
    • Developers can often develop on PCs beyond the control of corporate or business standardisation rules (e.g. freelancers who develop on their own machines (often remotely) or contributors to open source projects who are not 'employed' or 'contracted' to configure their PCs a certain way)
    • Some environments will consist of a fixed number of multiple machines in a load balanced configuration
    • Many production environments will have cloud-based servers dynamically (or 'elastically') created and destroyed depending on traffic levels

    As you can see the extrapolated total number of servers for an organisation is rarely in single figures, is very often in triple figures and can easily be significantly higher still.

    This all means that creating consistent environments in the first place is hard enough just because of sheer volume (even in a green field scenario), but keeping them consistent is all but impossible given the high number of servers, addition of new servers (dynamically or manually), automatic updates from o/s vendors, anti-virus vendors, browser vendors and the like, manual software installs or configuration changes performed by developers or server technicians, etc. Let me repeat that - it's virtually (no pun intended) impossible to keep environments consistent (okay, for the purist, it can be done, but it involves a huge amount of time, effort and discipline, which is precisely why VMs and containers (e.g. Docker) were devised in the first place).

    So think of your question more like this "Given the extreme difficulty of keeping all environments consistent, is it easier to deploying software to a docker image, even when taking the learning curve into account ?". I think you'll find the answer will invariably be "yes" - but there's only one way to find out, post this new question on Stack Overflow.

    0 讨论(0)
  • 2020-11-21 23:43

    Good answers. Just to get an image representation of container vs VM, have a look at the one below.

    Source

    0 讨论(0)
提交回复
热议问题