Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to quickly build commonly used third-party services by docker

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

Today, I would like to share with you the relevant knowledge points about how to quickly build commonly used third-party services in docker. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's learn about it.

This article covers several commands commonly used in docker:

Docker pull image name: version: pull the image

Docker rmi image name or id: delete an image

Docker images: get an existing local image

Docker run image name or id: start the image using the default port

Docker run-p port:port1-d image name or id: specify the port port to map to port1, and start the image in the background

Docker ps: view running docker containers

Docker ps-a: view all container services that have executed the run command (including containers that have been stopped)

Docker stop Container id: stops a container

Docker restart container id: restart a container

Docker rm container id: delete a container

Set up redis

To build a service through docker, you first need to go to the corresponding image from the image Kula. At present, there are also some good image resources in China, such as Ali, NetEase and other specific image address Internet search bar.

Docker pull redis

After executing the above command, you will get the following successful pull result:

Docker images

The command can see that it is already included in our local image.

Then start the redis container and view the startup through docker ps

Docker run-p 6378f06a5773f01e 6379-name redis-d f06a5773f01e

You can see that the redis container has been started. Access local port 6378 to map to 6379 of the container. Connect to the redis service through the redismanager client below.

Set up rabbit

The same rabbit image is pulled. Generally, rabbit needs a visual backend. Many images already contain manager management backend. My image here contains

Docker pull rabbitmqdocker run-p 5672 rabbitmq 5672-p 15672 rabbitmq 15672

There are two-p that specify the mapping of two ports respectively. If there are more ports, just overlay the mapping in turn, and display successfully.

At this time, you can browse directly in the browser (account number and password are by default)

Http://127.0.0.1:15672

Account number: guest

Password: guest

You can write your own program to send messages to port 5672 of the host ip where the docker is located, which can be viewed in the console 15672.

Set up elasticsearch

Execute the pull and run commands as above to run the mirror

Docker pull elasticsearchdocker run-p 9200 elasticsearch 9200-p 9300 elasticsearch 9300--

After running successfully, you can access http://127.0.0.1:9200/ directly in the browser to get the following successful interface

These are all the contents of the article "how to quickly build commonly used third-party services in docker". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report