File tree Expand file tree Collapse file tree 4 files changed +57
-3
lines changed
Expand file tree Collapse file tree 4 files changed +57
-3
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ echo " Hello, World!"
Original file line number Diff line number Diff line change 11FROM openjdk:8
22LABEL author="netbuffer" version="1.0"
3+ COPY help/docker-entrypoint.sh /
4+ RUN mkdir /docker-entrypoint.d
5+ ENTRYPOINT ["/docker-entrypoint.sh" ]
36WORKDIR /
47ENV JAVA_OPTS=
5- ADD target/spring-boot-demo .jar /
8+ ADD target/* .jar /app.jar
69EXPOSE 9100
7- ENTRYPOINT java ${JAVA_OPTS} -jar /spring-boot-demo .jar
10+ CMD java ${JAVA_OPTS} -jar /app .jar
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ services:
1010 cn.netbuffer.springboot.demo.author : " netbuffer"
1111 cn.netbuffer.springboot.demo.label-with-empty-value : " "
1212 image : netbuffer/spring-boot-demo:1.0
13+ container_name : spring-boot-demo-container
14+ hostname : spring-boot-demo
1315 ports :
1416 - " 9100:9100"
1517 mem_swappiness : 70
@@ -22,5 +24,6 @@ services:
2224 environment :
2325 TZ : Asia/Shanghai
2426 JAVA_OPTS : -Xms4g -Xmx8g
25- container_name : spring-boot-demo-container
2627 restart : " no"
28+ volumes :
29+ - .env/docker-entrypoint.d/:/docker-entrypoint.d
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # vim:sw=4:ts=4:et
3+
4+ set -e
5+
6+ entrypoint_log () {
7+ if [ -z " ${SBD_APP_ENTRYPOINT_QUIET_LOGS:- } " ]; then
8+ echo " $@ "
9+ fi
10+ }
11+
12+ if /usr/bin/find " /docker-entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2> /dev/null | read v; then
13+ entrypoint_log " $0 : /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
14+
15+ entrypoint_log " $0 : Looking for shell scripts in /docker-entrypoint.d/"
16+ find " /docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
17+ case " $f " in
18+ * .envsh)
19+ if [ -x " $f " ]; then
20+ entrypoint_log " $0 : Sourcing $f " ;
21+ . " $f "
22+ else
23+ # warn on shell scripts without exec bit
24+ entrypoint_log " $0 : Ignoring $f , not executable" ;
25+ fi
26+ ;;
27+ * .sh)
28+ if [ -x " $f " ]; then
29+ entrypoint_log " $0 : Launching $f " ;
30+ " $f "
31+ else
32+ # warn on shell scripts without exec bit
33+ entrypoint_log " $0 : Ignoring $f , not executable" ;
34+ fi
35+ ;;
36+ * ) entrypoint_log " $0 : Ignoring $f " ;;
37+ esac
38+ done
39+
40+ entrypoint_log " $0 : Configuration complete; ready for start up"
41+ else
42+ entrypoint_log " $0 : No files found in /docker-entrypoint.d/, skipping configuration"
43+ fi
44+
45+ exec " $@ "
You can’t perform that action at this time.
0 commit comments