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 ...
随机推荐
- windows7环境下 硬盘安装ubuntu 12.04 server版
之前一直用windows7环境下的虚拟机装的操作系统,但有时候在切换系统时老是死机,还是装一个硬盘版的ubuntu 12.04 server吧 先说一下本人的环境吧:windows 7 32位专业版+ ...
- /sbin/ifup: configuration for eth0 not found解决
/sbin/ifup: configuration for eth0 not found. Usage: ifup <device name> 那么应该是在/etc/sysconfig/n ...
- sip演示
发现了一个很好的演示sip的网页,现粘贴在下面: http://www.in2eps.com/fo-sip/tk-fo-sip-ex3261.html
- 多重背包问题的两种O(M*N)解法
多重背包的题目很多,最著名的是poj1742楼教主的男人八题之一. poj1742:coins 有几种面值的钱币和每种的数量,问能够组成m以内的多少种钱数 这个题大家都归为多重背包问题,不过跟实际意义 ...
- c指针点滴1
#include <stdio.h> #include <stdlib.h> void main() { ; int *p = #//&num是一个地址 ...
- CPU使用率统计办法
我们在搞性能测试的时候,对后台服务器的CPU利用率监控是一个常用的手段.服务器的CPU利用率高,则表明服务器很繁忙.如果前台响应时间越来越大,而后台CPU利用率始终上不去,说明在某个地方有瓶颈了,系统 ...
- 马士兵 Servlet_JSP(2) JSP源代码)
1.最简单的JSP HelloWorld.jsp <html> <head> <title>Hello</title> ...
- [Redux] Extracting Presentational Components -- TodoApp
Finally, I just noticed that the to-do app component doesn't actually have to be a class. I can turn ...
- 可失败构造器(Failable Initializers)
Xcode6.1中Swift的最新版本是1.1,在该版本中引入了一个新的特性:可失败构造器.通过构造器初始化实际上是给class或struct的每一个存储属性(参数)提供初始值,进行对象实例化的过程. ...
- using 关键字给类和名称空间指定别名
1. using System; using System.Text; namespace DLL { public class Class1 { public void showStr() { Co ...