所需软件:
jdk:jdk-8u381-linux-x64.tar.gz
kettle:pdi-ce-9.4.0.0-343
Dockerfile文件
FROM centos:7.6.1810
MAINTAINER wqs
#install jdk
ADD jdk-8u381-linux-x64.tar.gz /home/java
ENV JAVA_HOME=/home/java/jdk1.8.0_381
ENV CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH=$PATH:$JAVA_HOME/bin
RUN mkdir /opt/kettle
RUN echo "Asia/shanghai" > /etc/timezone
COPY data-integration /opt/kettle/data-integration/
# add kettle env
ENV KETTLE_HOME=/opt/kettle/data-integration
RUN chmod +x /opt/kettle/data-integration/*.sh
#create ktr job dir
RUN mkdir /opt/kettle/kettle_job
# open port
EXPOSE 8080
#start cart
CMD sh /opt/kettle/data-integration/carte.sh /opt/kettle/data-integration/carte.xml
打包
docker build -t registry.cn-hangzhou.aliyuncs.com/muguku/carte:9.4 .