From 313ca06605898656f83f053314eae806db668aa6 Mon Sep 17 00:00:00 2001 From: Sarit Kumar Si Date: Mon, 26 Apr 2021 19:38:34 -0700 Subject: [PATCH] Re-structured RUN commands Chaining of RUN commands done to decrease the image size --- setup-pentaho/Dockerfile | 46 +++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/setup-pentaho/Dockerfile b/setup-pentaho/Dockerfile index 4ae4245..493dd3e 100644 --- a/setup-pentaho/Dockerfile +++ b/setup-pentaho/Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8-jre LABEL maintainer="saritkumarsi@gmail.com" \ - version="1.0" \ + version="1.1" \ description="Docker file builds container with Pentaho Data Integration & Carte Server" # Set PDI user with permissions same as the Host machine. @@ -20,20 +20,13 @@ ENV PDI_RELEASE=9.1 \ PATH=${KETTLE_HOME}:${PATH} # Create Pentaho user home directory and required sub-folders -RUN mkdir -p ${PENTAHO_HOME}/templates ${PENTAHO_HOME}/scripts - -# Copy all required configs and entrypoint files -COPY carte-*-config.xml ${PENTAHO_HOME}/templates/ -COPY docker-entrypoint.sh ${PENTAHO_HOME}/scripts/ - +RUN mkdir -p ${PENTAHO_HOME}/templates ${PENTAHO_HOME}/scripts \ # Create Pentaho group passed as PENTAHO_GID arg -RUN command groupadd -r ${PENTAHO_GID} \ + && groupadd -r ${PENTAHO_GID} \ # Create Pentaho user with PENTAHO_UID same as Host UID, and assign to new group - && useradd -s /bin/bash -d ${PENTAHO_HOME} -r -g ${PENTAHO_GID} -u ${PENTAHO_UID} pentaho - -# Pentaho download and setup + && useradd -s /bin/bash -d ${PENTAHO_HOME} -r -g ${PENTAHO_GID} -u ${PENTAHO_UID} pentaho \ # Download PDI and save in PENTAHO_HOME -RUN /usr/bin/wget --progress=dot:giga \ + && /usr/bin/wget --progress=dot:giga \ https://sourceforge.net/projects/pentaho/files/Pentaho%20${PDI_RELEASE}/client-tools/pdi-ce-${PDI_VERSION}.zip \ -P ${PENTAHO_HOME} \ # Unzip PDI to /opt/ directory @@ -43,20 +36,25 @@ RUN /usr/bin/wget --progress=dot:giga \ # Create directory for the kettle.properties file && mkdir ${KETTLE_HOME}/.kettle \ # Make pentaho user owner of both PENTAHO_HOME and KETTLE_HOME directories - && chown -R pentaho ${PENTAHO_HOME} ${KETTLE_HOME} \ + && chown -R pentaho ${PENTAHO_HOME} ${KETTLE_HOME} + +# Copy carte configs and docker entrypoint file +COPY carte-*-config.xml ${PENTAHO_HOME}/templates/ +COPY docker-entrypoint.sh ${PENTAHO_HOME}/scripts/ + # Make entrypoint as executable - && chmod +x ${PENTAHO_HOME}/scripts/docker-entrypoint.sh +RUN chmod +x ${PENTAHO_HOME}/scripts/docker-entrypoint.sh -# Install App dependent packages, if any -# Download MySQL JDBC Connector to PENTAHO_HOME -RUN /usr/bin/wget --progress=dot:giga \ - https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.49.zip -P ${PENTAHO_HOME} \ -# Unzip MySQL jar file - && /usr/bin/unzip -q ${PENTAHO_HOME}/mysql-connector-java-5.1.49.zip -d ${PENTAHO_HOME} \ -# Copy unzipped jar file to /opt/data-integration - && cp ${PENTAHO_HOME}/mysql-connector-java-5.1.49/mysql-connector-java-5.1.49-bin.jar /opt/data-integration/lib \ -# Clean up downloaded files - && rm -R ${PENTAHO_HOME}/mysql-connector* +# # Install App dependent packages, if any +# # Download MySQL JDBC Connector to PENTAHO_HOME +# RUN /usr/bin/wget --progress=dot:giga \ +# https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.49.zip -P ${PENTAHO_HOME} \ +# # Unzip MySQL jar file +# && /usr/bin/unzip -q ${PENTAHO_HOME}/mysql-connector-java-5.1.49.zip -d ${PENTAHO_HOME} \ +# # Copy unzipped jar file to /opt/data-integration +# && cp ${PENTAHO_HOME}/mysql-connector-java-5.1.49/mysql-connector-java-5.1.49-bin.jar /opt/data-integration/lib \ +# # Clean up downloaded files +# && rm -R ${PENTAHO_HOME}/mysql-connector* USER pentaho