Docker is an open source application container engine based on the Go language and open sourced under the Apache 2.0 protocol.
Docker allows developers to package their applications and dependencies into a lightweight, portable container that can then be published to any popular Linux machine or virtualized.
Containers are completely sandboxed and do not have any interfaces with each other (similar to the iPhone’s app). More importantly, the container’s performance overhead is extremely low.
Docker application scenarios
- Web application automation packaged and released.
- Automated testing and continuous integration, release.
- Deploy and tune databases or other back-end applications in a service-oriented environment.
- Build or extend your existing OpenShift or Cloud Foundry platform from scratch to build your own PaaS environment.
Docker advantages
- 1, simplify the program:
Docker allows developers to package their applications and dependencies into a portable container and then publish it to any popular Linux machine for virtualization. Docker has changed the way of virtualization so that developers can directly put their own results into Docker for management. Convenience is already Docker’s biggest advantage. In the past, it took days or even weeks to complete the task, and it took only a few seconds to finish in the Docker container.
- 2. Avoid phobias:
If you have phobia, you are still a senior patient. Docker helps you pack your tangle! Such as the Docker image; Docker image contains the operating environment and configuration, so Docker can simplify the deployment of a variety of application examples work. For example, Web applications, background applications, database applications, big data applications such as Hadoop clusters, message queues, and so on can all be packaged into a single mirrored deployment.
- 3, save expenses:
On the one hand, the arrival of cloud computing era, so that developers do not have to configure high hardware for the pursuit of effect, Docker changed the mindset of high performance inevitable high prices. The combination of Docker and cloud makes the cloud space more fully utilized. Not only solved the problem of hardware management, but also changed the way of virtualization.
1.Docker’s installation:
Docker supports the following CentOS versions:
- CentOS 7 (64-bit)
- CentOS 6.5 (64-bit) or later
1.2 Prerequisites
Currently, Docker is supported by kernels in the CentOS distribution only.
Docker runs on CentOS 7 and requires a 64-bit system with a 3.10 or higher kernel version.
Docker runs on CentOS-6.5 or higher versions of CentOS. It requires a 64-bit system with a kernel version of 2.6.32-431 or higher.
My operating system version:
Centos7 officially installs docker CE instructions: https://docs.docker.com/install/linux/docker-ce/centos/
Docker packages and dependencies are included in the default CentOS-Extras source. You can update the yum source to install yum install, or you can choose to download the rpm package.
The official download address: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
1.3 Use wget command to download rpm package
Create a downloads folder and use the wget command to download
[root@sungeek downloads]# wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm
[ Root@sungeek downloads]# yum install docker-ce-18.03.0.ce-1.el7.centos.x86_64.rpm
1.4 Use yun install to install directly
I use yum update to update the yum source and install yum install
[root@rmohan downloads]# yum update
[root@rmohan downloads]# yum -y install docker-io
[root@localhost downloads]# docker –version –View the version, preferably using wget, so you can find the corresponding The latest installation package
Docker version 1.13.1, build 94f4240/1.13.1
1.5 Start the Docker Process
[root@localhost downloads]# systemctl start docker
[root@localhost downloads]# systemctl status docker
[root@localhost downloads]# systemctl enable docker –Set boot self-booting docker service
1.6 Verifying Successful Installation
Enter docker directly to list the usage of this command
Test Run First Container: hello-world
Since there is no hello-world image locally, a hello-world image will be downloaded and run inside the container.
2. The most commonly used commands
2.1 Use docker images to view images
[root@localhost downloads]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/hello-world latest e38bc07ac18e 2 months ago 1.85 kB
Docker ps is also the most commonly used command, -a : displays all containers, including those that are not running.
2.3 Use docker logs to view the container console output
Get the container’s log
Docker logs [container]
Recent Comments