Hello everyone, I am chu Chen, this chapter we learn Docker installation and simple use. Questions and comments can be sent to [email protected]

One: Install Docker

1: What is a Docker?

Docker is an open source application container engine that allows developers to package their applications and dependencies into a portable container and then distribute them to any popular Linux machine, as well as virtualization. Containers are completely sandboxed and have no interface with each other.

2: Download and install Docker

1. Open Docker Toolbox



Download the version suitable for your computer system, and then install Next

If the installation is successful, the following information is displayed



Click on the Docker Quickstart Terminal in the middle

The following figure shows successful installation



Note: Remember the green IP address for later use

Note: If you installed Git before installing Docker

Windows is looking for bash.exe. If you want to find the file yourself, please click on the “Browse” question

Right click on the icon and select Properties


To start the docker star.sh file, enter the correct Git bash.exe file location under the target option. My Git installation is under D:\ git, and Docker Toolbox is installed on disk C. So what I wrote here is:


D:\Git\bin\bash.exe — login -I “C:\Program Files\Docker Toolbox\start.sh”


You can adjust the execution of this section according to your installation configuration.


After modification, click Reference and OK, and then double-click the icon.

Install RabbitMQ using Docker

1. Access the docker Hub image warehouse address of netease Cloud: https://hub.docker.com/
2. Search for rabbitMq and go to the official images. We choose the version with “management” (including web management pages);



3. Pull the mirror
Docker pull the rabbitmq: 3.7.15 - management

Docker pull rebbitMQ is the name of the pull image. Latest is the latest version

The picture is shown after the download is successful



4: View the installed Docker image

docker images



You can see RabbitMQ has been installed successfully

5: Start RabbitMQ

$ docker run -d --hostname rabbit-host --name rabbitmq -e RABBITMQ_DEFAULT_USER=user -eRABBITMQ_DEFAULT_PASS=password -p 15672:15672 -p 5672:5672 rabbitMQ :3.7.15- ManagementCopy the code
Description:
-d Background running container;
–name Specifies the container name.
-p Specifies the port on which the service runs (5672: application access port; 15672: Console Web port number);
-v Mapping directory or file.
(one important thing about RabbitMQ is that it stores data according to what is called a “node name”, which is the hostname by default);
-e Specifies the environment variable. RABBITMQ_DEFAULT_VHOST: specifies the default VM name. RABBITMQ_DEFAULT_USER: default user name. RABBITMQ_DEFAULT_PASS: password for default user name)

After successful startup, the following figure is shown



6: Access the RabbitMQ management page

The browser enter http://192.168.99.100:15672/

Note: THE IP address is the one shown in green when Docker is started



The following page is displayed:



Enter the user and password we set when we started Docker



OK, the startup is successful

Common Docker commands

$docker stop containerId // containerId is the ID of the container $docker ps-a// View all containers $docker ps-a-q $docker stop $(docker ps-a-q) // stop Stop all containers $docker rm $(docker ps)-a-q) // remove remove all containers $docker images-a// View all containersCopy the code

Four: the ending

Thank you for your support, and this series of articles will continue to be updated. Thank you.

For springBoot do not know friends can see my springBoot series tutorial