Learning Docker--chapter 1
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的更多相关文章
- 机器学习(Machine Learning)&深度学习(Deep Learning)资料(Chapter 2)
##机器学习(Machine Learning)&深度学习(Deep Learning)资料(Chapter 2)---#####注:机器学习资料[篇目一](https://github.co ...
- 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 ...
- learning docker steps(8) ----- docker network 初次体验
参考: docker network 主要是介绍了docker 容器之间的组网模式, 一般来说实像组网主要是依赖于bridge iptalbes vlan来实现,但是附带的如端口转发会降低效率. 新型 ...
- learning docker steps(7) ----- docker registry 搭建
参考: https://docs.docker.com/engine/reference/builder/ https://hub.docker.com/_/registry/ https://www ...
- learning docker steps(6) ----- docker 镜像加速
http://www.docker-cn.com/registry-mirror 通过 Docker 官方镜像加速,中国区用户能够快速访问最流行的 Docker 镜像.该镜像托管于中国大陆,本地用户现 ...
- learning docker steps(5) ----- docker stack 初次体验
参考:https://docs.docker.com/get-started/part5/ stack 技术栈.技术栈是一组相关的服务,它们共享依赖项并且可以一起进行编排和扩展.单个技术栈能够定义和协 ...
- learning docker steps(4) ----- docker swarm 初次体验
参考:https://docs.docker.com/get-started/part4/ 了解 swarm 集群 swarm 是一组运行 Docker 并且已加入集群中的机器.执行此操作后,您可以继 ...
- learning docker steps(3) ----- docker services 初次体验
参考:https://docs.docker.com/get-started/part3/#docker-composeyml docker 的 service样例, 我们可以理解成是一个本地负载均衡 ...
- learning docker steps(2) ----- docker contailner 初次体验
参考:https://docs.docker-cn.com/get-started/part2/ Dockerfile的内容如下所示: # 将官方 Python 运行时用作父镜像 FROM pytho ...
- learning docker steps(1) ----- docker 安装
docker 安装 参考:https://docs.docker.com/install/linux/docker-ce/ubuntu/ 按如下指令可安装: $ sudo apt-get instal ...
随机推荐
- 《VIM-Adventures攻略》 LEVEL 1-3
此文已转至http://cn.abnerchou.me/2014/03/04/e40e2146/ 上期有人提到此游戏烂尾.其实没有啦,作者是位"贪财"的主,不付费不给玩剩下的章节. ...
- vim 折叠代码技巧汇总
以下命令输入的方式: 如zo命令,先按z键,松开后按o键即可展开折叠. 一.打开.关闭折叠 zo 展开折叠,只展开最外层的折叠. zO 对所在范围内所有嵌套的折叠点展开,包括嵌套折叠. zc 折叠,只 ...
- Android扩展 - 拍照篇(Camera)
1.调用系统摄像头 1.声明常量和变量 2.按钮点击事件,打开系统摄像头 3.重写onActivityResult事件接收拍照返回 4.生成文件名返回路径 5.保存图片 private static ...
- hdu 1385 Minimum Transport Cost
http://acm.hdu.edu.cn/showproblem.php?pid=1385 #include <cstdio> #include <cstring> #inc ...
- expect 批量监控主机
[oracle@OAPRIMARY shell]$ cat expect.sh while read line do user=`echo $line | awk '{print $1}'` ip=` ...
- bzoj 1189
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1189 这道题目看起来好像要用很高端的网络流. 这道题有一个特别之处,就是每一个空地都有人,不是 ...
- 面试题32.从1到n整数中1出现的次数
题目:输入一个整数n,求从1到n这n个整数的十进制表示中1出现的次数.例如输入12,从 1到12这些整数中包含1的数字中1,10,11和12,1一共出现了5次 本题可以直接变量1到n的n个数然后分别计 ...
- JAVA中运用数组的四种排序方法
JAVA中在运用数组进行排序功能时,一般有四种方法:快速排序法.冒泡法.选择排序法.插入排序法. 快速排序法主要是运用了Arrays中的一个方法Arrays.sort()实现. 冒泡法是运用遍历数组进 ...
- Redhat6.4 配置本地网络的FTP YUM源
Redhat6.4 配置本地网络的FTP YUM源 如果本机IP: 192.168.8.47 (一) 配置本机的yum源 使用以下的方法能够配置本机的yum源: 1) scp命令上传ISO文件到: / ...
- 跟我一起学extjs5(17--Grid金额字段单位MVVM方式的选择)
跟我一起学extjs5(17--Grid金额字段单位MVVM方式的选择) 这一节来完毕Grid中的金额字段的金额单位的转换.转换旰使用MVVM特性,整体上和控制菜单的几种模式类似.首先 ...