Using VMware12 to deploy Docker instances on CentOS7

Source: Internet
Author: User
Tags download redis ip number docker stop container docker ps docker run

This afternoon is actually engaged in an afternoon to get out, to think that Linux is my own dead hole, now can make out, the heart taste is not a lost, haha ~ ~ ~

Forget it, don't say much, direct! The steps are as follows:

1. In the case of installing the VMware12 and installing the CENTOS7 system (Linux Mirror Address: http://mirrors.163.com/centos/7/isos/x86_64/), open the software and select the "Edit" column below the " Virtual network editor, setting the bridging mode

Note the picture of the Red box information settings (subnet IP and subnet mask, etc., different network inconsistency, I was in the case of broadband connection)

2. Then turn on the "Network and Internet" of this machine, select the "VMware Virtual Ethernet Adapter for VMnet8" Nic under Network connection, right-select the properties, check the VMware Bridge Protocol, Also set the IP to get automatically, and under the shared bar check allow other network users to connect through this computer's Internet connection, and set up a home network connection as: VMware Virtual Ethernet Adapter VMnet1

See details

3, set the network settings of the virtual machine, select NAT mode

4. Start and log in to the virtual machine

5, Input command cd/etc/sysconfig/network-scripts, enter, then enter LS, enter, view all files, and then enter the command vi ifcfg-ens33 file, enter

6. Press the I key to enter edit mode, modify Bootproto=dhcp,onboot=yes, and set the corresponding IP address and DNS

Once modified, press ESC to exit edit mode and enter: X Save and exit

7. Input Service Network Restart Restart Network

8, re-enter the IP addr command to see if the network is set to success, there is a red box in the IP number indicates the setting OK (IP number according to the model inconsistent and inconsistent)

9, then install and open smartty connection CentOS7, I have been connected so there is a record can be directly double-click can open

10. Command: (Docker library: https://hub.docker.com/)

Note Three points:

External access requires shutting down the Firewall command: Service FIREWALLD stop

Download need to open Firewall command: Service FIREWALLD start

View firewall Status: Service FIREWALLD status

1) first check the Linux kernel version, must be 3.10 and above, enter the command in Smartty: uname-r

2) View Docker version command: DOCKER‐V

3) Install Docker command: Yum install Docker

4) Start Docker command: Systemctl start Docker

5) Set Docker boot command: Systemctl enable Docker

6) Stop Docker command: Systemctl stop Docker

7) Docker Mirroring Operation Command:

(1) Retrieving the Docker search keyword

Eg:docker Search Tomcat
(2) Draw: Docker pull mysql:5.6
(3) Mirror list: Docker images
(4) Remove mirrored Docker RMI Image-id

More commands can be accessed: https://hub.docker.com/

8) Docker container Operation command:

(1) Boot container command According to Image: Docker run--name mytomcat-d tomcat:latest

(2) View a running container command: Docker PS

(3) View all container commands: Docker ps-a

(4) start container command:Docker start container ID

(5) Stop container command in operation: Docker stop container ID

(6) Delete a container command: Docker RM container ID

(7) View the container's log command: Docker logs container ID

9) Start a tomcat command that does the port mapping:

Docker run-d-P 8888:8080 tomcat:latest

Host Port: The port inside the container

-D: Indicates background run

-P: Indicates that the port of the host is mapped to a port of the container

10) Install MySQL command: Docker pull mysql:5.6

Start Mysql:docker run--name mysql01-e mysql_root_password=123456-d MYSQL

Do port mapping run Mysql:docker run-p 3306:3306--name mysql01-e mysql_root_password=123456-d MYSQL

Start by doing port mapping and setting the character encoding to utf-8 MySQL:

Docker run-p 3306:3306--name mysql01-e mysql_root_password=123456-d mysql:5.6--character-set-server=utf8mb4--collation-server=utf8mb4_unicode_ci

11) Download Nginx:

Docker Pull Nginx:latest

Start nginx and map the port:

Docker run-d-P 8887:80 nginx:latest

12) Download Redis:

Docker Pull redis:3.2

Start Redis and map ports:

Docker run-d-P 6379:6379 redis:3.2

The above is I engaged in the results of an afternoon, finally on the success chart: I write the wrong or not standard place, trouble all the big guys can point out the message, Myunyu first write blog, will correct, thank you for your eyes, haha ~ ~ ~

Using VMware12 to deploy Docker instances on 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.