Docker series of technical installation Docker Desktop for Mac

Finally into the Docker technology series, and thank you for your continued attention.

Why choose Docker? Because Docker lightweight fast, offers a viable, cost-effective alternative. For example, to install Nginx, Mysql, Redis and other commonly used software development, a command to get. Not only for our development, testing, deployment provides convenient, but also save time to deal with more important things.

Then we come to understand what the next Docker below that?

First, the basic concept of Docker

Docker includes three basic concepts:

  • 镜像(Image): The equivalent of a root file system. For example, the official mirroring ubuntu: 16.04 contains the complete set of Ubuntu16.04 minimum system root file system. For example, nginx, mysql, redis software can be made into a mirror.
  • 容器(Container): Container can be created, start, stop, delete, pause.
  • 仓库(Repository): A code control center used to store mirrored. DockerHub is a cloud-based repository of Docker company operation and management. It is an online repository, Docker image can be published and used by other users. There are two libraries: public libraries and private storage repository. If you are a company, you can have a private repository within your own organization, and public image can be used by anyone.

Just started, will be used as much as possible, to understand what their pain points to address, with the depth we use, develop an understanding of its principles and structure are implemented.

Two, Docker Installation and Configuration

1, download and install Docker Desktop for Mac

Search on Docker hub site

Docker desktop for Mac

Below, click to get docker docker automatically download software.

2, third-party download mirror address

Official website to download more slowly, or by domestic image download. At the following address:

For users 10.10.3 following recommended Docker Toolbox

Mac installation file:

http://mirrors.aliyun.com/docker-toolbox/mac/docker-toolbox/

For more than 10.10.3 recommended Docker for Mac users

Mac installation file:

http://mirrors.aliyun.com/docker-toolbox/mac/docker-for-mac/

After the download is complete, open the downloaded file directory, find the corresponding installation package. Double-click to start the installation program, drag it to the Applications folder to start to start the installation process.

3, installation problems may occur.

Note: After starting the installation, suggesting that the source is not reliable, if installed, click OK to install. Pay special attention to this place, the first pop-up box to enter a password management mac, the second entry is the docker's account password. After verification, continue the installation.

4, docker verify whether the installation was successful

Enter the following command,

docker version

If you have a version of the output, then congratulations, you are a successful installation.

Three, Docker image accelerator

1. Why do you want to configure the accelerator?

You need to download an official image when using Docker, such as mysql, wordpress. However, due to network reasons, to download a Docker official image may take a long time, and even download failed.

2, how to obtain the accelerator?

Here we use Ali cloud docker mirror Accelerator: Ali cloud docker mirror accelerator need to register an account, everyone has their own unique address.

https://dev.aliyun.com/search.html

3, how to configure the accelerator?

Docker for Mac users can refer to the following configuration steps:

Right-click the desktop icon in the top bar of the docker, choose Preferences, arrays Registry mirrors a list of addresses will be mirrored in the Docker Engine label:

"registry-mirrors": ["https://你的前缀地址.mirror.aliyuncs.com"]

Click Apply & Restart button and wait for Docker restart and application image accelerator configuration.

4, check whether the configuration accelerator

Execute  docker info commands and return results that contain the following, the configuration was successful.

https://你的前缀地址.mirror.aliyuncs.com/

Four, Docker learn command

Installation finished Docker, we briefly familiarize yourself with the basic commands of Docker's. Docker's command git commands with most of the concepts are similar.

The most commonly used mirror Docker three basic operations login, pull, push.

1, landing (login)

If you say that got me to a private warehouse needs, you need to log in to the cloud Ali warehouse,

Method 1: Enter the user name password

docker login registry.cn-hangzhou.aliyuncs.com

Enter your username and password to login

Username:登陆名
Password:密码
Login Succeeded

Second way: Specifies the login name login

docker login --username=你的地址@aliyun.com registry.cn-hangzhou.aliyuncs.com

Enter the password to login.

Note: the user's login name when Docker Ali cloud client account full name, password is the password Ali cloud settings.

By looking at config.json document confirming your login information.

cat ~/.docker/config.json

The following information describes the output of a successful landing

{
"auths": {
"https://index.docker.io/v1/": {},
"registry.cn-hangzhou.aliyuncs.com": {}
}

Description: I am here to visit the official, also landed a mirror accelerator. If you want to download the image in a common warehouse, not landing mirroring accelerator is available for download. But if you want to push to mirror the warehouse, then the client will be reported unauthorized.

2, pulling (pull)

Git like this, the client generally git to pull code via git pull, where the image is to pull through docker pull.

Pulling public repository mirror

docker pull helloworld

Pull private warehouse Mirror

docker pull registry.cn-hangzhou.aliyuncs.com/镜像名字

3, view the downloaded image

Through docker imagesto view local downloaded image.

4, upload image

Mirroring After building a local environment or packed, it can be uploaded Registry. Registry indicates the address, do not enter the official website of default.

docker push registry.cn-hangzhou.aliyuncs.com/用户名/镜像名:版本号

5, start a container

Run helloworld project's official website mirroring:

docker run helloworld

Description, if the absence of a run-time image, is automatically pulled from the official website.

Accelerator mirror.

docker run registry.cn-hangzhou.aliyuncs.com/镜像名字

Our first experience with a simple application. We were then follow explain how to install Nginx, Mysql, Redis and other applications by Docker. Little deeper Docker Compose, DockerFile and so on. Preview Theme:

Docker 技术系列之安装Docker for Mac
Docker 技术系列之安装单机版数据库Mysql
Docker 技术系列之安装服务器Nginx
Docker 技术系列之安装单机版本Redis
Docker 技术系列之安装Web服务器Tomcat
Docker 技术系列之安装Docker Compose
Docker 技术系列之DockerFile体验
Docker 技术系列之安装文档数据库MongoDB
Docker 技术系列之安装关系数据库oracle
Docker 技术系列之安装Node.js
Docker 技术系列之安装Web服务器Jetty
Docker 技术系列之安装集群版本Redis
Docker 技术系列之安装集群版数据库Mysql

Follow-up to add enterprise-level Docker + Jenkins + Git combat, while adding other topics.

Here are some of my computer to install the application.

understand more

The first chapter of the United States feel mac - for a way to use a computer, open a new course
chapter feel the beauty of Mac - Mac peripherals stunning from the beginning, after a week using the experience
the United States chapter of the Mac experience - must have installed one in a million software
Chapter Mac experience the beauty - efficiency from the operation shortcut to start
the fifth chapter Mac system software - installed basic software Java Web development environment

 

 

Guess you like

Origin www.cnblogs.com/liuhongfeng/p/12505743.html