File tree Expand file tree Collapse file tree 7 files changed +122
-4
lines changed Expand file tree Collapse file tree 7 files changed +122
-4
lines changed Original file line number Diff line number Diff line change 26
26
<groupId >org.springframework.cloud</groupId >
27
27
<artifactId >spring-cloud-starter-netflix-eureka-client</artifactId >
28
28
</dependency >
29
+ <!-- https://mvnrepository.com/artifact/com.google.cloud.tools/jib-maven-plugin -->
30
+ <dependency >
31
+ <groupId >com.google.cloud.tools</groupId >
32
+ <artifactId >jib-maven-plugin</artifactId >
33
+ <version >3.1.1</version >
34
+ </dependency >
29
35
30
36
<dependency >
31
37
<groupId >org.springframework.boot</groupId >
51
57
<groupId >org.springframework.boot</groupId >
52
58
<artifactId >spring-boot-maven-plugin</artifactId >
53
59
</plugin >
60
+ <plugin >
61
+ <groupId >com.google.cloud.tools</groupId >
62
+ <artifactId >jib-maven-plugin</artifactId >
63
+ <version >3.1.1</version >
64
+ <configuration >
65
+ <from >
66
+ <image >adoptopenjdk:11-jre-hotspot</image >
67
+ </from >
68
+ <to >
69
+ <image >config-server</image >
70
+ </to >
71
+ <container >
72
+ <entrypoint >
73
+ <shell >bash</shell >
74
+ <option >-c</option >
75
+ <arg >/entrypoint.sh</arg >
76
+ </entrypoint >
77
+ <ports >
78
+ <port >9296</port >
79
+ <port >9296/udp</port >
80
+ </ports >
81
+ <environment >
82
+ <SPRING_OUTPUT_ANSI_ENABLED >ALWAYS</SPRING_OUTPUT_ANSI_ENABLED >
83
+ <SLEEP >0</SLEEP >
84
+ </environment >
85
+ <creationTime >USE_CURRENT_TIMESTAMP</creationTime >
86
+ <user >1000</user >
87
+ </container >
88
+ <extraDirectories >
89
+ <paths >src/main/docker/jib</paths >
90
+ <permissions >
91
+ <permission >
92
+ <file >/entrypoint.sh</file >
93
+ <mode >755</mode >
94
+ </permission >
95
+ </permissions >
96
+ </extraDirectories >
97
+ </configuration >
98
+ </plugin >
54
99
</plugins >
55
100
</build >
56
101
Original file line number Diff line number Diff line change
1
+ version : ' 3.8'
2
+ services :
3
+ config-server :
4
+ image : cevheri/config-server
5
+ environment :
6
+ - _JAVA_OPTIONS=-Xmx512m -Xms256m
7
+ - LOGGING_FILE_NAME=/tmp/microservices-sr.log
8
+ ports :
9
+ - 9296:9296
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ echo " The application will start in ..."
4
+ exec java ${JAVA_OPTS} -noverify -XX:+AlwaysPreTouch -Djava.security.egd=file:/dev/./urandom -cp /app/resources/:/app/classes/:/app/libs/* " com.cevher.ms.config.ConfigServerApplication" " $@ "
Original file line number Diff line number Diff line change 19
19
<properties >
20
20
<java .version>11</java .version>
21
21
<spring-cloud .version>2020.0.3</spring-cloud .version>
22
+ <jib-maven-plugin .version>2.8.0</jib-maven-plugin .version>
22
23
</properties >
23
24
<dependencies >
24
25
<dependency >
50
51
<groupId >org.springframework.boot</groupId >
51
52
<artifactId >spring-boot-maven-plugin</artifactId >
52
53
</plugin >
54
+ <plugin >
55
+ <groupId >com.google.cloud.tools</groupId >
56
+ <artifactId >jib-maven-plugin</artifactId >
57
+ </plugin >
58
+
53
59
</plugins >
60
+
61
+ <pluginManagement >
62
+ <plugins >
63
+ <plugin >
64
+ <groupId >com.google.cloud.tools</groupId >
65
+ <artifactId >jib-maven-plugin</artifactId >
66
+ <version >${jib-maven-plugin.version} </version >
67
+ <configuration >
68
+ <from >
69
+ <image >adoptopenjdk:11-jre-hotspot</image >
70
+ </from >
71
+ <to >
72
+ <image >service-registry:latest</image >
73
+ </to >
74
+ <container >
75
+ <entrypoint >
76
+ <shell >bash</shell >
77
+ <option >-c</option >
78
+ <arg >/entrypoint.sh</arg >
79
+ </entrypoint >
80
+ <ports >
81
+ <port >8761</port >
82
+ <port >8761/udp</port >
83
+ </ports >
84
+ <environment >
85
+ <SPRING_OUTPUT_ANSI_ENABLED >ALWAYS</SPRING_OUTPUT_ANSI_ENABLED >
86
+ <JHIPSTER_SLEEP >0</JHIPSTER_SLEEP >
87
+ </environment >
88
+ <creationTime >USE_CURRENT_TIMESTAMP</creationTime >
89
+ <user >1000</user >
90
+ </container >
91
+ <extraDirectories >
92
+ <paths >src/main/docker/jib</paths >
93
+ <permissions >
94
+ <permission >
95
+ <file >/entrypoint.sh</file >
96
+ <mode >755</mode >
97
+ </permission >
98
+ </permissions >
99
+ </extraDirectories >
100
+ </configuration >
101
+ </plugin >
102
+ </plugins >
103
+ </pluginManagement >
54
104
</build >
55
105
56
106
</project >
Original file line number Diff line number Diff line change
1
+ #deprecated use app.yml
1
2
FROM openjdk:11-jre-slim
2
-
3
-
4
3
ARG JAR_FILE=target/*.jar
5
4
COPY ${JAR_FILE} app.jar
6
5
ENTRYPOINT ["java","-jar","/app.jar"]
7
6
EXPOSE 8761
8
-
9
-
10
7
# docker build -t cevher/microservices-service-registry .
11
8
# docker run -p 8761:8761 cevher/microservices-service-registry
Original file line number Diff line number Diff line change
1
+ version : ' 3.8'
2
+ services :
3
+ service-registry :
4
+ image : service-registry
5
+ environment :
6
+ - _JAVA_OPTIONS=-Xmx512m -Xms256m
7
+ - LOGGING_FILE_NAME=/tmp/microservices-sr.log
8
+ ports :
9
+ - 8761:8761
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ echo " The application will start in ..."
4
+ exec java ${JAVA_OPTS} -noverify -XX:+AlwaysPreTouch -Djava.security.egd=file:/dev/./urandom -cp /app/resources/:/app/classes/:/app/libs/* " com.cevher.ms.service.registry.ServiceRegistryApplication" " $@ "
You can’t perform that action at this time.
0 commit comments