使用docker-compose定制dubbo-admin和zookeeper组合服务

环境:已经安装了git和maven,系统centos

1.打包dubbo-admin

mvn clean package -Dmaven.test.skip=true
 
2.制作dubbo-admin镜像
dubbo-admin下增加Dockerfile
文件内容如下:
FROM openjdk:8-jdk-alpine
MAINTAINER yangxianyu
VOLUME /tmp
ADD ./target/dubbo-admin-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
 
docker build -t dubbo-admin:1.0 .
 
3.运行compose项目
incubator-dubbo-ops下增加docker-compose.yml
文件内容如下:
version: '3.4'
services:
  zk_server:
   image: zookeeper:3.4
   ports:
    - 2181:2181
  dubbo-admin:
   image: dubbo-admin:1.0
   links:
    - zk_server:zookeeper
   depends_on:
    - zk_server
   ports:
    - 7001:7001
 
运行compose项目
docker-compose up
 
posted @ 2019-04-05 16:11  Nice&&Day  阅读(1891)  评论(0编辑  收藏  举报