-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chaining of RUN commands done to decrease the image size
- Loading branch information
Showing
1 changed file
with
22 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
FROM openjdk:8-jre | ||
|
||
LABEL maintainer="[email protected]" \ | ||
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 | ||
|
||
|