Install docker on Mac (easy installation solution)

1. What is docker?

1. Three basic concepts of Docker:

  • Image(mirror)
  • Container(container)
  • Repository

The idea of ​​Docker comes from containers. What problems do containers solve?
On a large ship, cargo can be arranged neatly. And all kinds of goods are standardized by containers, and containers will not affect each other. Then I don’t need a ship specifically for carrying fruits and a ship specifically for carrying chemicals. As long as these goods are packed well in the container, then I can transport them all on a big ship. docker is a similar concept. Cloud computing is now popular, and cloud computing is like a big freighter. Docker is a container.

If you don’t understand it yet, if you understand it this way, you will understand docker as a courier truck.
So does the express truck have packages? The package can be understood as an image, the image can be understood as a Java class, and the container can be understood as an instance of the Java class. There is only one class, but thousands of instance objects can be created by new. Therefore, an image is just something that can generate a container, and the container can make the program run.

For warehouses, for example, you should have used git. It can be completely understood as git, upload and pull operations.

2. So what are the benefits of docker?
The simplest example is, for example, if you deploy a project on a server at the beginning, then the deployment project must be configured with mysql and other environments, right? Now you want to migrate the project to another server, and you have to redo it again. Write it on another server and rewrite the configuration of mysql and other environments. Errors such as version confusion may occur, which is very troublesome. So now when you deploy the project for the first time, put the project and other environments directly into docker. Next time you want to migrate Move the project to another server, upload the docker image to the docker warehouse yourself, and then pull it from another server. This is just one of the benefits.

2. Install Docker on Mac

1. The premise is to install homebrew

(If it is not installed, you can open a terminal and enter the following command to install Homebrew)

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. Enter the command on the console (the installation process takes some time, you can read the following steps first)

brew install –cask –appdir=/Applications docker

The successful installation is displayed as follows:

Then you can see docker in the application

3. Click on docker

Tip: You need to enter your computer password (just enter it)

4. Check the successful installation command

docker --version

The following display indicates successful installation

Related Posts

DataSourceTransactionManager Summary

[Wuji Low Code] Low code platform development diary, low code platform sql programming

[Exception]The field file exceeds its maximum permitted size of 1,048,576 bytes.

Android studio button click page jump

Java project: Design and implementation of online Heihei network disk system (java+Springboot+ssm+mysql+maven)

Junit unit testing

From shallow to deep, I will take you through the three ways to implement array expansion in Java [recommended collection]

Ethereum 2.0 client Prysm builds and runs node records

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*