Use Micro Services Architecture Foundation --- Docker's

Micro Services Architecture Foundation - use of Docker

Experimental and requirements

Master the use of dockerfile

Common usage instructions grasp docker

Docker master image management

lab environment

Install Ubuntu

Installation docker

A, Docker entry procedures

1, write Dockerfile file

Here Insert Picture Description
Here Insert Picture Description

2, the preparation of an external file requirements.txt and app.py

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

3, create a mirror

Here Insert Picture Description
Here Insert Picture Description

4, to view mirror

Here Insert Picture Description

5, create and launch container

Here Insert Picture Description

6, view the running container

Here Insert Picture Description

7, access to the program, view the results

Here Insert Picture Description

8, stop the container

Here Insert Picture Description

Two, Docker customers frequently used instructions

1, lists the mirror

Here Insert Picture Description
Here Insert Picture Description

2, Search Mirror

Here Insert Picture Description

3, pulling the mirror

Here Insert Picture Description
Pull the specified version
Here Insert Picture Description

4, the mirror Construction

4.1 Construction of the mirror in the directory where the file dockerfile

Here Insert Picture Description

4.1 Construction of a mirror in a different directory

Here Insert Picture Description
Here Insert Picture Description

5, view mirror, and remove a mirror

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

6, create and launch container

Here Insert Picture Description

7, listed container

Here Insert Picture Description

8, execute the command

Here Insert Picture Description

9, the container is stopped, and respectively use the stop ki

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

10, the container starts, start and restart respectively, using

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

11, remove the container

Forced to delete

Here Insert Picture Description
Here Insert Picture Description

delete all

Here Insert Picture Description

Three, Docker image management

1. Log Docker Hub

Here Insert Picture Description

2, modify the name of the mirror

Here Insert Picture Description
Here Insert Picture Description

3, login authentication

Here Insert Picture Description

4, push mirror

Here Insert Picture Description

5, page view docker Hub

Here Insert Picture Description

6, docker reegistry local private warehouse building

6.1 Starting docker reegistry

Here Insert Picture Description

6.2 Renaming a mirror

Here Insert Picture Description

6.3 Push mirroring

Here Insert Picture Description

6.4 for viewing in the host browser

Here Insert Picture Description

6.5 is mapped to the local disk to view it

Here Insert Picture Description

7, docker reegistry local private warehouse configuration

7.1 View docker reegistry private warehouse building address

Here Insert Picture Description

7.2 generates a self-signed certificate

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

7.3 generation user name and password

Here Insert Picture Description
Here Insert Picture Description

7.4 Starting Docker Registry local mirror warehousing services

Here Insert Picture Description

7.5 Configuring docker reegistry access interface

Here Insert Picture Description

7.6 Verification Test

7.6.1 docker reegistry private warehouse registration

Here Insert Picture Description

7.6.2 restart docker process

Here Insert Picture Description

7.6.3 ready image file

Here Insert Picture Description

7.6.4 Push mirroring

Here Insert Picture Description

7.6.5 Log docker reegistry mirror warehouse

Here Insert Picture Description

7.6.6 to see if the local push success

Here Insert Picture Description

Learn a trick: Docker accelerator configuration

Here Insert Picture Description

Personal summary

By this experiment I summarized as follows:

      在Ubuntu里面编辑配置文件特别困难,首先配置桥接模式,然后连接Xshell工具,这样编辑配置文件的出错率就降低了。在做实验过程中细心是关键,比如创建镜像名和拉取镜像名必须一致,不然就会拉取失败。

Guess you like

Origin blog.csdn.net/weixin_43306493/article/details/93708740