From 6a377e82e8b5f22c3f6f4834167c920e4c76b591 Mon Sep 17 00:00:00 2001 From: caryyu Date: Fri, 23 Nov 2018 10:26:06 +0800 Subject: [PATCH] Docker: add Dockerfile for the xxl-job-executor-samples-springboot as a common executor --- .../.dockerignore | 6 +++++ .../Dockerfile | 23 +++++++++++++++++++ .../docker-entrypoint.sh | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 xxl-job-executor-samples/xxl-job-executor-sample-springboot/.dockerignore create mode 100644 xxl-job-executor-samples/xxl-job-executor-sample-springboot/Dockerfile create mode 100644 xxl-job-executor-samples/xxl-job-executor-sample-springboot/docker-entrypoint.sh diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/.dockerignore b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/.dockerignore new file mode 100644 index 00000000..68efd36f --- /dev/null +++ b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/.dockerignore @@ -0,0 +1,6 @@ +.gitignore +.git/ +src/ +target/ +target/*.jar.original +!target/*.jar \ No newline at end of file diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/Dockerfile b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/Dockerfile new file mode 100644 index 00000000..45ea4060 --- /dev/null +++ b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/Dockerfile @@ -0,0 +1,23 @@ +FROM openjdk:8-jre + +LABEL name="caryyu/xxl-job-executor-sample-springboot" \ + maintainer="Caryyu <343194291@qq.com>" \ + version="0.1" \ + description="A common xxl-job executor image for easily shipping via Docker" + +ENV jarName=xxl-job-executor-sample-springboot-2.0.1.jar + +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/TZ /etc/localtime && echo TZ /etc/localtime && echo TZ > /etc/timezone + +ADD ./target/$jarName / + +ADD ./docker-entrypoint.sh / + +RUN chmod u+x /docker-entrypoint.sh + +WORKDIR / + +EXPOSE 8080 + +ENTRYPOINT ["/docker-entrypoint.sh"] \ No newline at end of file diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/docker-entrypoint.sh b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/docker-entrypoint.sh new file mode 100644 index 00000000..9e939128 --- /dev/null +++ b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/docker-entrypoint.sh @@ -0,0 +1,2 @@ +#!/bin/bash +java ${JAVA_OPTS} -jar ${jarName} $@ \ No newline at end of file