From 318dc7cf2e586c7ab017e93d668052cee653d0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= Date: Fri, 17 Jan 2020 20:46:22 +0800 Subject: [PATCH] :whale: Work about Docker. docker-maven-plugin --- db/Dockerfile | 4 ++-- docker-compose.yml | 21 +++++++-------------- pig-auth/Dockerfile | 2 +- pig-auth/pom.xml | 4 ++++ pig-codegen/Dockerfile | 2 +- pig-codegen/pom.xml | 4 ++++ pig-gateway/Dockerfile | 2 +- pig-gateway/pom.xml | 4 ++++ pig-monitor/Dockerfile | 2 +- pig-monitor/pom.xml | 4 ++++ pig-register/Dockerfile | 3 +-- pig-register/pom.xml | 4 ++++ pig-upms/pig-upms-biz/Dockerfile | 2 +- pig-upms/pig-upms-biz/pom.xml | 4 ++++ pom.xml | 29 +++++++++++++++++++++++++++++ 15 files changed, 68 insertions(+), 23 deletions(-) diff --git a/db/Dockerfile b/db/Dockerfile index 1d07ef44..1eaa502d 100644 --- a/db/Dockerfile +++ b/db/Dockerfile @@ -4,6 +4,6 @@ MAINTAINER lengleng(wangiegie@gmail.com) RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime -COPY ./db/pig.sql /docker-entrypoint-initdb.d +COPY ./pig.sql /docker-entrypoint-initdb.d -COPY ./db/pig_config.sql /docker-entrypoint-initdb.d +COPY ./pig_config.sql /docker-entrypoint-initdb.d diff --git a/docker-compose.yml b/docker-compose.yml index 39a99272..e5fd040b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,8 +2,7 @@ version: '2' services: pig-mysql: build: - context: ./ - dockerfile: ./db/Dockerfile + context: ./db environment: MYSQL_ROOT_PASSWORD: root restart: always @@ -22,8 +21,7 @@ services: pig-register: build: - context: ./ - dockerfile: ./pig-register/Dockerfile + context: ./pig-register restart: always ports: - 8848:8848 @@ -33,8 +31,7 @@ services: pig-gateway: build: - context: ./ - dockerfile: ./pig-gateway/Dockerfile + context: ./pig-gateway restart: always ports: - 9999:9999 @@ -44,8 +41,7 @@ services: pig-auth: build: - context: ./ - dockerfile: ./pig-auth/Dockerfile + context: ./pig-auth restart: always container_name: pig-auth hostname: pig-auth @@ -53,8 +49,7 @@ services: pig-upms: build: - context: ./ - dockerfile: ./pig-upms/pig-upms-biz/Dockerfile + context: ./pig-upms/pig-upms-biz restart: always container_name: pig-upms hostname: pig-upms @@ -62,8 +57,7 @@ services: pig-monitor: build: - context: ./ - dockerfile: ./pig-monitor/Dockerfile + context: ./pig-monitor restart: always ports: - 5001:5001 @@ -73,8 +67,7 @@ services: pig-codegen: build: - context: ./ - dockerfile: ./pig-codegen/Dockerfile + context: ./pig-codegen restart: always container_name: pig-codegen hostname: pig-codegen diff --git a/pig-auth/Dockerfile b/pig-auth/Dockerfile index 27027d27..b173b085 100755 --- a/pig-auth/Dockerfile +++ b/pig-auth/Dockerfile @@ -10,6 +10,6 @@ WORKDIR /pig-auth EXPOSE 3000 -ADD ./pig-auth/target/pig-auth.jar ./ +ADD ./target/pig-auth.jar ./ CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-auth.jar diff --git a/pig-auth/pom.xml b/pig-auth/pom.xml index d9f6a1bf..d5a38f7d 100755 --- a/pig-auth/pom.xml +++ b/pig-auth/pom.xml @@ -85,6 +85,10 @@ org.springframework.boot spring-boot-maven-plugin + + io.fabric8 + docker-maven-plugin + diff --git a/pig-codegen/Dockerfile b/pig-codegen/Dockerfile index d721382d..5ab0cb78 100755 --- a/pig-codegen/Dockerfile +++ b/pig-codegen/Dockerfile @@ -10,6 +10,6 @@ WORKDIR /pig-codegen EXPOSE 5003 -ADD ./pig-codegen/target/pig-codegen.jar ./ +ADD ./target/pig-codegen.jar ./ CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-codegen.jar diff --git a/pig-codegen/pom.xml b/pig-codegen/pom.xml index 2165b3b0..c5180f19 100755 --- a/pig-codegen/pom.xml +++ b/pig-codegen/pom.xml @@ -88,6 +88,10 @@ org.springframework.boot spring-boot-maven-plugin + + io.fabric8 + docker-maven-plugin + diff --git a/pig-gateway/Dockerfile b/pig-gateway/Dockerfile index 342a6de0..4794a67e 100755 --- a/pig-gateway/Dockerfile +++ b/pig-gateway/Dockerfile @@ -10,6 +10,6 @@ WORKDIR /pig-gateway EXPOSE 9999 -ADD ./pig-gateway/target/pig-gateway.jar ./ +ADD ./target/pig-gateway.jar ./ CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-gateway.jar diff --git a/pig-gateway/pom.xml b/pig-gateway/pom.xml index cf2ed906..4b739332 100755 --- a/pig-gateway/pom.xml +++ b/pig-gateway/pom.xml @@ -80,6 +80,10 @@ org.springframework.boot spring-boot-maven-plugin + + io.fabric8 + docker-maven-plugin + diff --git a/pig-monitor/Dockerfile b/pig-monitor/Dockerfile index 35377516..29e0634f 100755 --- a/pig-monitor/Dockerfile +++ b/pig-monitor/Dockerfile @@ -10,6 +10,6 @@ WORKDIR /pig-monitor EXPOSE 5001 -ADD ./pig-monitor/target/pig-monitor.jar ./ +ADD ./target/pig-monitor.jar ./ CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-monitor.jar diff --git a/pig-monitor/pom.xml b/pig-monitor/pom.xml index 7810593e..5a346233 100755 --- a/pig-monitor/pom.xml +++ b/pig-monitor/pom.xml @@ -69,6 +69,10 @@ org.springframework.boot spring-boot-maven-plugin + + io.fabric8 + docker-maven-plugin + diff --git a/pig-register/Dockerfile b/pig-register/Dockerfile index 492068b0..f3061d05 100644 --- a/pig-register/Dockerfile +++ b/pig-register/Dockerfile @@ -10,8 +10,7 @@ WORKDIR /pig-register EXPOSE 8848 -ADD ./pig-register/target/pig-register.jar ./ - +ADD ./target/pig-register.jar ./ CMD sleep 30;java -Djava.security.egd=file:/dev/./urandom -jar pig-register.jar diff --git a/pig-register/pom.xml b/pig-register/pom.xml index 64a9c04c..2c58f0c0 100755 --- a/pig-register/pom.xml +++ b/pig-register/pom.xml @@ -70,6 +70,10 @@ org.springframework.boot spring-boot-maven-plugin + + io.fabric8 + docker-maven-plugin + diff --git a/pig-upms/pig-upms-biz/Dockerfile b/pig-upms/pig-upms-biz/Dockerfile index 55977753..d56e1105 100644 --- a/pig-upms/pig-upms-biz/Dockerfile +++ b/pig-upms/pig-upms-biz/Dockerfile @@ -10,6 +10,6 @@ WORKDIR /pigx-upms EXPOSE 4000 -ADD ./pig-upms/pig-upms-biz/target/pig-upms-biz.jar ./ +ADD ./target/pig-upms-biz.jar ./ CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar pig-upms-biz.jar diff --git a/pig-upms/pig-upms-biz/pom.xml b/pig-upms/pig-upms-biz/pom.xml index c7f9fcd6..8b1cc631 100644 --- a/pig-upms/pig-upms-biz/pom.xml +++ b/pig-upms/pig-upms-biz/pom.xml @@ -88,6 +88,10 @@ org.springframework.boot spring-boot-maven-plugin + + io.fabric8 + docker-maven-plugin + diff --git a/pom.xml b/pom.xml index 42ee4924..227209d9 100755 --- a/pom.xml +++ b/pom.xml @@ -48,6 +48,12 @@ 2.1.0 2.9.2 2.3.6.RELEASE + http://172.17.0.111:2375 + 172.17.0.111 + library + admin + Harbor12345 + 0.32.0 @@ -180,6 +186,29 @@ + + io.fabric8 + docker-maven-plugin + ${docker.plugin.version} + + ${docker.host} + ${docker.registry} + + + ${docker.username} + ${docker.password} + + + + + ${docker.host}/${docker.namespace}/${project.name}:${project.version} + + ${project.basedir}/Dockerfile + + + + +