使用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 www.fabaoyi.com
VOLUME /tmp
ADD ./target/dubbo-admin-0.0.1-SNAPSHOT.jar dubbo-admin.jar
ENTRYPOINT [“java”,”-Djava.security.egd=file:/dev/./urandom”,”-jar”,”/dubbo-admin.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

Leave a Reply