CONTENTS:

(1) An introduction to Docker

(2) Docker on Linux

(3) Differentiating between containerization and virtualization

(4) Installing the Docker engine

(5) Understanding the Docker setup

(6) Downloading the first image

(7) Running the first container

(8) Running a Docker container on Amazon Web Services

(9) Troubleshooting the Docker container

(1) An introduction to Docker

Virtualization technology has serious drawbacks, such as performance degradation due to the heavyweight nature of virtual machines, the lack of application portability, slowness in provisioning of IT resources, and so on. Therefore, the Docker initiative has been designed for making the containerization paradigm easier to grasp and use. Docker enables the containerization process to be accomplished in a risk-free and accelerated fashion. (My: Virtualization have some disadvantages and developers want to design Docker to deal with these disadvantages)

Docker is an open source containerization engine, which automates the packaging, shipping, and deployment of any software applications that are presented as lightweight, portable, and self-sufficient containers, that will run virtually anywhere. (My: The definition of Docker)

A Docker container is a software bucket comprising everything necessary to run the software independently. There can be multiple Docker containers in a single machine and containers are completely isolated from one another as well as from the host machine.

In other words, a Docker container includes a software component along with all of its dependencies(binaries, libraries, configuration files, scripts, jars, and so on).The Docker container has its own process space and network interface. It can run things as root, and have its own /sbin/init, which can be different from the host machines.

The Docker solution primarily consists of the following components:

  • The Docker engine
  • The Docker Hub

The Docker engine is for enabling the realization of purpose-specific as well as generic Docker container. The Docker Hub is a repository of the Docker images that can be combined in different ways for producing publicly findable, network-accessible, and widely usable containers. (My: Docker engine is a tool and Docker Hub is a repository.)

(2) Docker on Linux

The preceding diagram vividly illustrates how future IT systems would have hundreds of application-aware containers, which would be capable of facilitating their seamless integration and orchestration for deriving modular applications. These contained applications could fluently run on converged, federated, virtualized, share, dedicated, and automated infrastructures.

(3) Differentiating between containerization and virtualization

In the containerization paradigm, some of underutilized capabilities of the Linux kernel have been rediscovered.

The following table gives a direct comparison between virtual machines and containers:

Virtual Machines(VMs)

Containers

Represents hardware-level virtualization

Represents operating system virtualization

Heavyweight

Lightweight

Slow provisioning

Real-time provisioning and scalability

Limited performance

Native performance

Fully isolated and hence more secure

Process-level isolation and hence less secure

The convergence of containerization and virtualization

Traditional hypervisors, which represent hardware virtualization, directly secure the environment with the help of the server hardware. That is, VMs are completely isolated from the other VMs as well as from the underlying systems. But for containers, this isolation happens at the process level and hence, they are liable for any kind of security incursion. Furthermore, some vital features that are available in the VMs are not available in the containers. For instance, there is no support for SSH, TTY, and the other security functionalities in the containers. On the other hand, VMs are resource-hungry and hence, their performance gets substantially degraded. Indeed, in containerization parlance, the overhead of a classic hypervisor and a guest operating system will be eliminated to achieve bare mental performance. Therefore, a few VMs can be provisioned and made available to work on a single machine. Thus, on one hand, we have the fully isolated VMs with average performance and on the other hand, we have the containers that lack some of the key features, but are blessed with high performance. (My: VMs are completely isolated from the other VMs, Container are liable for security incursion. Container don’t have some vital features that are available in the VMs. VMs with average performance, but container with high performance by lacking of some of key features.)

(4) Installing the Docker engine

Ellipsis.(省略)

(5) Understanding the Docker setup

$ sudo docker version

These following output lines means:

  • The client version
  • The client API version
  • The server version
  • The server API version

If we dissect the internals of the docker version subcommand, then it will first list the client-related information that is stored locally. Subsequently, it will make a REST API call to the server over HTTP to obtain the server-related details.

$ sudo docker –D info

This command lists details, such as the Containers, Images, Storage Driver, Location, Executive Driver, Kernel Version, the Operating System, the number of CPUs, the Total Memory, and Name, the new Docker hostname.

Client server communication

On Linux installations, Docker is usually programmed for carrying out server-client communication by using the Unix socket (/var/run/docker.sock). Docker has IANA( The Internet Assigned Numbers Authority) registered port, which is 2375. However, for security reasons, this port is not enabled by default.

(6)     Downloading the first Docker image

$ sudo docker pull busybox

Once the images have been downloaded, they can be verified by using the docker images subcommand, as shown here:

$ sudo docker images

(7) Running the first Docker container

$ sudo docker run busybox echo “Hello World!”

“Hello World!”

 

In the preceding example, the docker run subcommand has been used for creating a container and for printing Hello World! by using the echo command.

(8) Running a Docker container on Amazon Web Services

Ellipsis.(省略). I don’t have Amazon’s account. /(ㄒoㄒ)/~~

(9)     Troubleshooting

Most of the time, you will not encounter any issues when installing Docker. However, unplanned failures might occur. Therefore, it is necessary to discussing the troubleshooting techniques and tips. The first tip is that the running status of Docker should be checked by using the following command:

$ sudo service docker status

 

If the docker service is running, then this command will print the status as start/running along with its process ID. If you are still experiencing issues with the Docker setup, then you could open the Docker log by using the /var/log/upstart/docker.log file for further investigation.

Summary

Containerization is going to be a dominant and decisive paradigm for enterprise as well as cloud IT environment in the future because of its hitherto unforeseen automation and acceleration capabilities. There are several mechanisms in place for taking the containerization movement to greater heights. However, Docker has zoomed ahead of everyone in this hot race, and it has successfully decimated the previously-elucidated barriers.

感谢《Learning Docker》,转载请注明出处,O(∩_∩)O谢谢

Learning Docker--chapter 1的更多相关文章

  1. 机器学习(Machine Learning)&深度学习(Deep Learning)资料(Chapter 2)

    ##机器学习(Machine Learning)&深度学习(Deep Learning)资料(Chapter 2)---#####注:机器学习资料[篇目一](https://github.co ...

  2. Learning WCF Chapter 3 Bindings One-Way and Duplex Communication

    One-Way and Duplex Communication A message exchange pattern describes the way messages are sent betw ...

  3. learning docker steps(8) ----- docker network 初次体验

    参考: docker network 主要是介绍了docker 容器之间的组网模式, 一般来说实像组网主要是依赖于bridge iptalbes vlan来实现,但是附带的如端口转发会降低效率. 新型 ...

  4. learning docker steps(7) ----- docker registry 搭建

    参考: https://docs.docker.com/engine/reference/builder/ https://hub.docker.com/_/registry/ https://www ...

  5. learning docker steps(6) ----- docker 镜像加速

    http://www.docker-cn.com/registry-mirror 通过 Docker 官方镜像加速,中国区用户能够快速访问最流行的 Docker 镜像.该镜像托管于中国大陆,本地用户现 ...

  6. learning docker steps(5) ----- docker stack 初次体验

    参考:https://docs.docker.com/get-started/part5/ stack 技术栈.技术栈是一组相关的服务,它们共享依赖项并且可以一起进行编排和扩展.单个技术栈能够定义和协 ...

  7. learning docker steps(4) ----- docker swarm 初次体验

    参考:https://docs.docker.com/get-started/part4/ 了解 swarm 集群 swarm 是一组运行 Docker 并且已加入集群中的机器.执行此操作后,您可以继 ...

  8. learning docker steps(3) ----- docker services 初次体验

    参考:https://docs.docker.com/get-started/part3/#docker-composeyml docker 的 service样例, 我们可以理解成是一个本地负载均衡 ...

  9. learning docker steps(2) ----- docker contailner 初次体验

    参考:https://docs.docker-cn.com/get-started/part2/ Dockerfile的内容如下所示: # 将官方 Python 运行时用作父镜像 FROM pytho ...

  10. learning docker steps(1) ----- docker 安装

    docker 安装 参考:https://docs.docker.com/install/linux/docker-ce/ubuntu/ 按如下指令可安装: $ sudo apt-get instal ...

随机推荐

  1. android开发3:四大基本组件的介绍与生命周期

    android开发3:四大基本组件的介绍与生命周期 Android四大基本组件分别是Activity,Service服务,Content Provider内容提供者,BroadcastReceiver ...

  2. NOR flash和NAND flash区别,RAM 和ROM区别

    ROM和RAM指的都是半导体存储器,ROM是Read Only Memory的缩写,RAM是Random Access Memory的缩写.ROM在系统停止供电的时候仍然可以保持数据,而RAM通常都是 ...

  3. 【Xamarin 开发 IOS --IOS ViewController生命周期】

    ViewController ViewController是IOS开发中MVC模式中的C,ViewController是view的controller,ViewController的职责主要包括管理内 ...

  4. SQL判断一个数是整数还是小数

    DECLARE @number1 AS numeric(10,2),@number2 AS numeric(10,2) SELECT @number1=10.00,@number2=10.2 SELE ...

  5. 【转】Ubuntu 10.04 LTS 的窗口控制按钮从左上角调整到右上角

    原文网址:http://www.linuxidc.com/Linux/2010-05/26111.htm 升级到Ubuntu 10.04后最大的问题,是最小最大和关闭按钮,放到了左边.这叫Ubuntu ...

  6. jQuery中ajax的使用和缓存问题解决 $getjson 与$get都会被IE缓存

    原文地址:http://www.cnblogs.com/fullhouse/archive/2012/01/17/2324842.html 1:GET访问 浏览器 认为 是等幂的就是 一个相同的URL ...

  7. BaseAdapter自定义适配器——思路详解

    BaseAdapter自定义适配器——思路详解 引言: Adapter用来把数据绑定到扩展了AdapterView类的视图组.系统自带了几个原生的Adapter. 由于原生的Adapter视图功能太少 ...

  8. js_day8

  9. 使用 Fluent API 配置/映射属性和类型2

    1.将多个实体类映射到数据库中的一个表 要将多个实体映射到一个数据库表需要满足: a. 两个实体必须是一对一关系 b.两个实体共享一个主键 public class MyContext:DbConte ...

  10. GDI+编程的10个基本技巧(转)

    创建绘图表面 创建绘图表面有两种常用的方法.下面设法得到PictureBox的绘图表面. private void Form1_Load(object sender, System.EventArgs ...