Understanding docker from a layman point of view

房东的猫 提交于 2019-12-21 02:54:31

问题


I am just one day old to docker , so it is relatively very new to me .

I read the docker.io but could not get the answers to few basic questions . Here is what it is:

  1. Docker is basically a tool which allows you to make use of the images and spin up your own customised images by installing softwares so that you can use to create the VMs using that .

Is this what docker is all about from a 10000 ft bird's eye piont of view?

2 . What exactly is the meaning of a container ? Is it synonymn for image?

3 . I remember reading somewhere that it allows you to deploy applications. Is this correct ? In other words will it behave like IIS for deploying the .net applications?

Please answer my questions above , so that I can understand it better and take it forward.


回答1:


1) What docker is all about from a 10000 ft bird's eye point of view?

From the website: Docker is an open-source engine that automates the deployment of any application as a lightweight, portable, self-sufficient container that will run virtually anywhere.

Drill down a little bit more and a thorough explanation of the what/why docker addresses:

  • https://www.docker.io/the_whole_story/
  • https://www.docker.io/the_whole_story/#Why-Should-I-Care-(For-Developers)
  • https://www.docker.io/the_whole_story/#Why-Should-I-Care-(For-Devops)

Further depth can be found in the technology documentation:

  • http://docs.docker.io/introduction/technology/

2) What exactly is the meaning of a container ? Is it synonymn for image?

An image is the set of layers that are built up and can be moved around. Images are read-only.

  • http://docs.docker.io/en/latest/terms/image/
  • http://docs.docker.io/en/latest/terms/layer/

A container is an active (or inactive if exited) stateful instantiation of an image.

  • http://docs.docker.io/en/latest/terms/container/

See also: In Docker, what's the difference between a container and an image?

3)I remember reading somewhere that it allows you to deploy applications. Is this correct ? In other words will it behave like IIS for deploying the .net applications?

Yes, Docker can be used to deploy applications. You can deploy single components of the application stack or multiple components within a container. It depends on the use case. See the First steps with Docker page here: http://docs.docker.io/use/basics/

See also:

  • http://docs.docker.io/examples/nodejs_web_app/
  • http://docs.docker.io/examples/python_web_app/
  • http://docs.docker.io/examples/running_redis_service/
  • http://docs.docker.io/examples/using_supervisord/



回答2:


So.

  1. It's about providing the separation of processes that you get with virtualisation without the overhead. Of course this doesn't come without a cost - which in this case the largest one is that your docked containers will all be running under the same kernel.
  2. A container is roughly a chroot (with better process encapsulation) and some ethernet virtualisation. The image is the filesystem (plus a few bits) that is mounted to provide the root filesystem^1
  3. deploy is just the term docker uses for spinning up a container instance.

Effectively, each running instance of a container thinks that it is the only thing^2 running on that machine (much like a cloud appliance is typically designed). It provides more separation of processes than running on the host OS would provide, and allows for easily spinning up multiple separate copies of the container as needed; while providing much, much lower overheads than using full virtualisation would need.

^1: Actually there may be several layers of file-system sandwiched together to form the root file system.

^2: Docker does support multiple processes running within a single instance, but that is generally considered to be somewhat advanced usage.



来源:https://stackoverflow.com/questions/23916900/understanding-docker-from-a-layman-point-of-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!