Installation and use of Docker and go

Source: Internet
Author: User
Tags docker ps docker hub docker run
This is a creation in Article, where the information may have evolved or changed. It feels like the current Docker is as unstoppable as the 2013 spark, so it's necessary to learn more about Docker. We use the operating system for CentOS Linux release 7.2.1511 (Core) (64-bit). This article mainly introduces the installation and use of Docker, the installation and use of Go.

I. Installation and use of Docker

1. Installation of Docker

Yum-y Install Docker
Description: The Docker package is already included in the default Centos-extras software source.

2. Start the Docker service

Systemctl start Docker.servicesystemctl Enable Docker.service
Description: And set Docker to boot.

3. Download the official CentOS image to the local

Docker Pull CentOS
Description:

4. Confirm that the CentOS image has been acquired

Docker Images CentOS
5. Run a docker container
Docker Run--rm-ti Centos/bin/bash
Description:--rm tells Docker to delete the container as soon as the running process exits. This is useful when testing, and eliminates clutter. -ti tells Docker to assign a pseudo-terminal and enter interactive mode. This goes into the container and is useful for rapid prototyping or trying, but do not open these flags in the production container. To break the connection to the container, enter exit.
Cat/etc/redhat-release exit
6. Displays the list of currently running containers
Docker PS
Description: The installation and startup commands for Docker in Ubuntu are wget-qo-https://get.docker.com/| sh and sudo start Docker, and other operations are described in Docker commands and parameters. The Docker core is an operating system-level virtualization approach that provides a deep understanding of Docker's technical details from four aspects of the virtualization approach: Isolation, scalability/scalability, portability, and security. I believe in the future of virtualization technology.


Two. Installation and use of Go

The go installation and use takes place on Windows 10, as follows:

1. Installation of Go

The software version you use is Go1.5.windows-amd64.msi. Configure the environment variable goroot and path after the installation is complete.

2. Programming for Go

Hello.go the contents of the file as follows:

Package Mainimport "FMT" Func Main () {  fmt. Printf ("hello,go!\n")}
Execute command: Go run hello.go

Note: If you are using a Linux system, you need to download the appropriate go binaries and then configure the Goroot and PATH environment variables. If you are downloading go source, then you need to install the appropriate dependencies (sudo apt-get install bison ed gawk gcc Libc6-dev make), because the go language part of the function is developed in C language. If you want to use IntelliJ idea for go development, you need to install the appropriate plugin go-lang-idea-plugin[5][6], and you are accustomed to using liteide for Go programming.


Three. Docker commands

1. Docker version

Parsing: Viewing the Docker version

2. Docker Images

Parsing: viewing downloaded images

3. Docker PS

Parsing: Viewing a running container

4. Docker Info

Resolution: Displays Docker system information, including the number of mirrors and containers.

5. Docker Search

Parse: Search for eligible mirrors from the Docker hub.

6. Docker Pull

Parse: Pulls or updates the specified image from the Docker hub.

7. Docker Login

Resolution: Enter the user name, password, and mailbox registered in the Docker hub to complete the login process.

8. Docker Images

Parse: Lists all local mirrors.

9. Docker History

Parse: View the creation history of the specified image.

Ten. Docker Start|stop|restart

Parse: Starts, stops, and restarts one or more specified containers.

One. Docker Kill

Parse: Kills one or more specified container processes.

Docker Save

Parse: Saves the specified image as a tar archive and the reverse operation of Docker load.

Docker load

Resolution: The reverse operation of Docker save is downloaded from the TAR image archive, photographed.

Docker Export

Parse: Saves the specified container as a tar archive file, and the reverse operation of Docker import.

. Docker Import

Resolution: Create an image from an archive file (supporting remote files), and export the reverse operation to label the import image.

. Docker Pause

Resolve: Pauses all processes for a container.

. Docker Unpause

Parse: Restores all processes of a container.

Docker push

Resolution: Pushes the image to the remote repository, which defaults to the Docker Hub.

. Docker Run

Parse: Launches a container in which to run the specified command.

Reference documents:

[1] Docker Getting started in action: Http://yuedu.baidu.com/ebook/d817967416fc700abb68fca1?fr=aladdin&key=docker&f=read

[2] What are some questions about Docker?: https://www.zhihu.com/question/25394149

[3] Docker tutorial:http://dockone.io/topic/docker%20tutorial

[4] What Docker is doing on Infoq: http://www.infoq.com/cn/dockers/?utm_source=infoq&utm_medium=header_graybar&utm_ Campaign=topic_clk

[5] Installing the Go language plugin in IntelliJ IDEA14: http://www.cnblogs.com/speeding/p/4881281.html

[6] IntelliJ idea 14 installing Golang plug-in go-lang-idea-plugin:http://aigo.iteye.com/blog/2214136

[7] Golang Environment construction: http://www.cnblogs.com/draem0507/p/3327487.html

Related Article

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.