Win10 & Linux Docker Installation use

Source: Internet
Author: User
Tags docker ps docker run

Docker has recently launched a stable version that can run on Win10 and Macs, so let's take a quick look.

One, Windows Docker installation 1. Installation

Required conditions are: 64bit Windows 10, turn on Hyper-V

1.1 Turn on Win10 Hyper-V

Control Panel, programs, enable or turn off Windows features, select Hyper-V

Automatic Restart after completion

1.2 Download docker for Windows, installing

Can be downloaded from the following address on the official website

Https://download.docker.com/win/stable/InstallDocker.msi

Install with the installation package you just downloaded, and after the installation is complete, start Docker

If Hyper-V is not turned on, you are prompted to turn on Hyper-V when starting Docker

If you start with insufficient memory and boot failure, you can adjust the VM memory size in Settings

1.3 Confirm that Docker is working

Start-to-run->cmd performs Docker info, which displays Docker information correctly stating that Docker is normal

Ii. Linux Docker installation 1. Installation

Usage Environment: CentOS 7.5

1.1 Installing Epel

Yum install Docker hints that no packages are available because Docker is located in a third-party Yum source and not in the official CentOS Yum source

Solution: Install Epel;

Go to Epel official website: Http://fedoraproject.org/wiki/EPEL download; it's a little hard to find.

Reference URL

1.2 Installing Docker

1.3 Confirm that Docker is working

Perform Docker info to display Docker information correctly stating that Docker is normal

If Docker does not start, it will be prompted with service Docker start

1.4 Turn off SELinux, use Getenforce query

Temporary shutdown (without restarting the machine):

Setenforce 0 # #设置SELinux become permissive mode

# #setenforce 1 set SELinux to become enforcing mode

Modifying the configuration file requires restarting the machine:

Modify the/etc/selinux/config file

Change Selinux=enforcing to Selinux=disabled

Restart the machine

Third, Docker use

Using Nginx in Docker

Common commands:

Docker info
Docker version

1. Download image

Docker Pull Nginx
or Docker run Nginx

2. View images and Containers

Docker images
Container for Docker PS operation

3. Running Mirrors and containers

Docker run-p 80:80--name nginx1 nginx
Start container
Docker start container ID

4. Go to bash running container

Docker exec-it Nginx/bin/bash
or Docker to open SSH host SSH connection into

5, into the container Linux configuration Nginx

#配置tomcat的IP地址和访问端口
Upstream GW {
Server 192.168.0.82:8080 weight=1;
Server 192.168.0.82:8080 weight=1;
}
#Nginx代理配置
Location/{
Proxy_pass HTTP://GW;
}

Nginx-t
Nginx-s Reload

6. Download the package in Linux

1.DPKG Debian Package System
Representative: Debian,ubuntu
Apt-get Update software source, read package list
Apt-get Install Vim

2.RPM (Red Hat package Manager)
Representative: Centos,redhat,fedora
Yum-y Update
Yum Install vim
DNF Install Vim

7, production package, release package

1. Use the Docker commit command to create a mirror
Docker commit container ID yilei/nginx:8.8 (docker tag)
Docker Run New image
Docker Login
Docker Push Yilei/nginx

2. Using the Docker Build command and the Dockerfile file
Vim Dockerfile
Docker Build-t yilei/nginx:8.8
Docker Run New image
Docker Login
Docker Push Yilei/nginx



Win10 & Linux Docker Installation use

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.