The first step in learning Docker technology based on ASP: Installing the Docker platform in CentOS7

Source: Internet
Author: User
Tags docker ps docker run

Docker technology has been on fire a few years ago, and with the popularity of this year's devops, this technology has been sought after by the technology community. The mention of Docker is easily assumed to be a technology under the Linux platform. NET technology doesn't seem to matter to him, but it's a non-. NET core technology, and since the new push of. NET core technology can support the platform, then of course it's no problem running on the Docker platform. Net The Core Installation Guide is dedicated to the Docker platform.

The coolest feature of Docker technology is of course the consistency of the running environment, thinking back without Docker or Docker, in the development, testing and deployment of environment maintenance configuration cumbersome, labor-intensive, annoy the developers. With Docker, the deployment of automation to a new level, and even developers in the development of the machine to run the program, and then publish a Docker image, and then the user pull down the image, to get Docker run it, is not very simple. It seems simple, technical implementation is still to understand, such as how to create their own image, how to use the technology of. NET Core with Docker.

Then install the Docker platform from the very basics.

In fact, it is relatively simple, the official description, there is the advantage of the installation guide is not to knock the command line, copy and paste the command line is enough.

Keep a record of the brief steps, and later forget it or pick it back again.

1 Installing the minimized version of CentOS7

As for why choose CentOS7, not because the Docker platform can only run on Linux, but enterprises generally use this as a server system.

(Of course Docker is also able to run on Windows (at least WINDOWS10 above), running on Windows needs to rely on Hyperv,windows to install Docker relatively simple, not in detail. )

CentOS7 installs the minimized feature version.

2 Configuring static IP and DNS domain name resolution after installing the system static IP and DNS domain name resolution, set the static IP is to allow Xshell to continue to connect the server after the next reboot, set up DNS is to resolve some Docker related domain names, because the download image is accessed through the domain name. Set static IP command

Vim/etc/sysconfig/network-scripts/ifcfg-ens33

The main setting is the value of the following items, the IP address is set according to the specific value

bootproto= "Static"
Ipaddr= "192.168.115.136"
netmask= "255.255.255.0"
Gateway= "192.168.115.2"

Set up DNS

Vim/etc/sysconfig/network

Join a row

dns1=8.8.8.8

Of course, set other IP can also, can be used on the line.

3 Follow the official tutorial install Docker Reference Official Guide https://docs.docker.com/engine/installation/linux/docker-ce/centos/here is the way to set up a docker warehouse installation

sudo yum install-y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager--add-repo Https://download.docker.com/linux/centos/docker-ce.repo
sudo yum-config-manager--enable Docker-ce-edge #可选
sudo yum-config-manager--enable docker-ce-test #可选
sudo yum install Docker-ce

4 Starting Docker
sudo systemctl start Docker #启动Docker
sudo systemctl enable Docker.service #设置Docker服务开机启动

5 Add Docker user groups and users (optional) after the installation is complete, Docker creates a Docker user group and creates one without the other. Udo Groupadd Docker then add the current user to the Docker user group sudo usermod-ag Docker $USER 6 run Hello-world mirrored container sudo docker run Hello-world #基于he Llo-world image Create a container the above command will download the Hello-world image locally, then create a container based on the image and run the container. The output from the above command can be seen in the output of the Hello from docker!, indicating that the Docker platform can be successfully run and you can view the local image through the Docker images command

REPOSITORY TAG IMAGE ID CREATED SIZE
Hello-world latest 05A3BD381FC2 2 weeks ago 1.84kB

View the currently running containers via Docker ps-a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
C0872B507BDC Hello-world "/hello" Ten seconds ago Exited (0) 9 seconds ago Adoring_colden

The server environment for this Docker is enough, what about. NET core, not running ASP.

Docker is now used, of course, these will be resolved through the Docker image, followed by detailed introduction.

The first step in learning Docker technology based on ASP: Installing the Docker platform in CentOS7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.