Commit 900f97e9 by wutong

elastic-jobCD/CI

parent 5c93bec5
FROM maven:3.6.0-alpine
RUN apk update && apk add ca-certificates && \
RUN apk add ca-certificates && \
apk add tzdata && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone
# make source folder
RUN mkdir -p /usr/app
WORKDIR /usr/app
COPY data-elastic-job /
# install maven dependency packages (keep in image)
ENV VERSION 3.0.0.M1
ENV CONSOLE_PATH data-elastic-job/elastic-job-lite-console
ENV ROOT_USERNAME root
ENV ROOT_PASSWORD root
ENV GUEST_USERNAME guest
ENV GUEST_PASSWORD guest
COPY data-elastic-job /usr/app/data-elastic-job
RUN mvn package -DskipTests -f ${CONSOLE_PATH}/pom.xml \
# 复制console包
&& mv ${CONSOLE_PATH}/target/elastic-job-lite-console-${VERSION}.tar.gz /elastic-job-lite-console-${VERSION}.tar.gz \
# 删除源码解压文件夹
&& rm -rf elastic-job-lite-${VERSION} \
# 解压console
&& tar -zxvf /elastic-job-lite-console-${VERSION}.tar.gz \
# 删除console压缩包
&& rm -rf /elastic-job-lite-console-${VERSION}.tar.gz
RUN cd "/usr/app/data-elastic-job" && mvn install -Dmaven.test.skip=true
RUN tar -xzf "/usr/app/data-elastic-job/elastic-job-lite-console/target/elastic-job-lite-console-3.0.0.M1-SNAPSHOT.tar.gz"
RUN chmod +x "/usr/app/data-elastic-job/elastic-job-lite-console/target/elastic-job-lite-console-3.0.0.M1-SNAPSHOT/bin/start.sh"
ADD entrypoint.sh entrypoint.sh
#指定容器启动程序及参数 <ENTRYPOINT> "<CMD>"
EXPOSE 8899
RUN chmod a+x /entrypoint.sh
ENTRYPOINT ["/usr/app/data-elastic-job/elastic-job-lite-console/target/elastic-job-lite-console-3.0.0.M1-SNAPSHOT/bin/start.sh"]
ENTRYPOINT /entrypoint.sh
#!/bin/bash
# 修改认证配置文件
sed -i "s/root.username=root/root.username=${ROOT_USERNAME}/g" elastic-job-lite-console-${VERSION}/conf/auth.properties
sed -i "s/root.password=root/root.password=${ROOT_PASSWORD}/g" elastic-job-lite-console-${VERSION}/conf/auth.properties
sed -i "s/guest.username=guest/guest.username=${GUEST_USERNAME}/g" elastic-job-lite-console-${VERSION}/conf/auth.properties
sed -i "s/guest.password=guest/guest.password=${GUEST_PASSWORD}/g" elastic-job-lite-console-${VERSION}/conf/auth.properties
elastic-job-lite-console-${VERSION}/bin/start.sh
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment