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

Detailed explanation of how to build and generate dubbo-admin Image in multiple steps by Docker

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

preface

Dubbo is Alibaba's open source distributed service framework, which is characterized by a layered approach to architecture, which allows decoupling (or maximum loose coupling) between layers. From the service model point of view, Dubbo adopts a very simple model, either the provider provides the service or the consumer consumes the service, so based on this, two roles of service provider and service consumer can be abstracted. About registry, protocol support, service monitoring, etc.

Docker supports multi-step builds. For builds that require compiling source code, multi-step builds can get smaller images on the one hand, and do not need to manually clean up source code and other files on the other hand.

Sometimes when debugging locally, you need to start a dubbo-admin to see, but every time you start a tomcat, and then copy war, it's a bit troublesome for a long time. I want to start one from Docker image, but it is not officially provided. There are a lot of personally built mirrors online, but the versions are a little old. Put it on Docker Hub.

Manual operation is more direct, clone the code base, and then maven package out of war package, put tomcat run can be.

The Dockerfile built in multiple steps is as follows:

FROM maven:3-jdk-8RUN git clone --depth 1 https://github.com/apache/incubator-dubbo-ops.git /sourceWORKDIR /sourceRUN mvn package -f dubbo-admin FROM tomcat:8.0-jre8RUN rm -rf /usr/local/tomcat/webapps/COPY --from=0 /source/dubbo-admin/target/*.war /usr/local/tomcat/webapps/ROOT.warEXPOSE 8080

When running, you can provide the environment variable of the registry (dubbo.registry.address).

If it is docker-compose, it is written as follows:

version: '3' services: zookeeper: image: zookeeper admin: image: htynkn/dubbo-admin depends_on: - zookeeper ports: - 8080 environment: - dubbo.registry.address=zookeeper://zookeeper:2181

summary

The above is the whole content of this article, I hope the content of this article has a certain reference value for everyone's study or work, if you have questions, you can leave a message to exchange, thank you for your support.

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

Servers

Wechat

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

12
Report