-
-
Save manas86/ed48f440da49c17cbbee6bd0cb4f3f12 to your computer and use it in GitHub Desktop.
Custom Docker file
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
FROM adoptopenjdk/openjdk8:jdk8u192-b12-alpine | |
RUN apk add --update --no-cache bash \ | |
curl \ | |
krb5-libs \ | |
krb5 \ | |
libidn \ | |
libstdc++ \ | |
libuuid \ | |
sed \ | |
sudo && \ | |
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf | |
ARG SDC_UID=20159 | |
ARG SDC_GID=20159 | |
# Begin Data Collector installation | |
ARG SDC_VERSION=3.8.0 | |
#ARG SDC_URL=http://nightly.streamsets.com.s3-us-west-2.amazonaws.com/datacollector/latest/tarball/streamsets-datacollector-core-${SDC_VERSION}.tgz | |
ARG SDC_URL=https://archives.streamsets.com/datacollector/3.8.0/tarball/streamsets-datacollector-core-3.8.0.tgz | |
ARG SDC_USER=sdc | |
# SDC_HOME is where executables and related files are installed. Used in setup_mapr script. | |
ARG SDC_HOME="/app/streamsets/streamsets-datacollector" | |
ENV SDC_CONF="${SDC_HOME}/etc" \ | |
SDC_DATA="${SDC_HOME}/data" \ | |
SDC_DIST="${SDC_HOME}" \ | |
SDC_HOME="${SDC_HOME}" \ | |
SDC_LOG="${SDC_HOME}/logs" \ | |
SDC_RESOURCES="${SDC_HOME}/resources" \ | |
USER_LIBRARIES_DIR="${SDC_HOME}/streamsets-datacollector-user-libs" | |
ENV STREAMSETS_LIBRARIES_EXTRA_DIR="${SDC_DIST}/streamsets-libs-extras" | |
RUN addgroup --system ${SDC_USER} && \ | |
adduser --system --disabled-password -u ${SDC_UID} -G ${SDC_USER} ${SDC_USER} | |
RUN mkdir -p ${SDC_HOME} | |
RUN mkdir -p ${SDC_CONF} | |
RUN cd /tmp && \ | |
curl -o /tmp/sdc.tgz -L "${SDC_URL}" && \ | |
tar xzf /tmp/sdc.tgz --strip-components 1 -C "${SDC_HOME}" && \ | |
rm -rf /tmp/sdc.tgz | |
# Add logging to stdout to make logs visible through `docker logs`. | |
RUN sed -i 's|INFO, streamsets|INFO, streamsets,stdout|' "${SDC_DIST}/etc/sdc-log4j.properties" | |
RUN for i in \ | |
"${SDC_DATA}" \ | |
"${SDC_LOG}" \ | |
"${SDC_RESOURCES}" \ | |
"${USER_LIBRARIES_DIR}" \ | |
"${STREAMSETS_LIBRARIES_EXTRA_DIR}" \ | |
"${SDC_DIST}/streamsets-libs" \ | |
"${SDC_CONF}" ; \ | |
do \ | |
mkdir -p $i && chgrp -R 0 $i && chmod -R g=u $i; \ | |
done | |
#RUN sudo mv "${SDC_DIST}/etc" "${SDC_CONF}" | |
RUN sed -i 's|--status|-s|' "${SDC_DIST}/libexec/_stagelibs" | |
RUN chown -R "${SDC_USER}:${SDC_USER}" "${SDC_DIST}/streamsets-libs" \ | |
"${SDC_CONF}" \ | |
"${SDC_DATA}" \ | |
"${SDC_LOG}" \ | |
"${SDC_RESOURCES}" \ | |
"${STREAMSETS_LIBRARIES_EXTRA_DIR}" | |
#COPY sdc-configure.sh *.tgz /tmp/ | |
# RUN mkdir -p ${SDC_HOME} && \ | |
# mkdir -p ${SDC_CONF} && \ | |
# chmod 755 /tmp/sdc-configure.sh && \ | |
# /tmp/sdc-configure.sh | |
WORKDIR "${SDC_HOME}/streamsets-libs/" | |
#INSTALL JDBC STAGES | |
RUN "${SDC_DIST}/bin/streamsets" stagelibs -install=streamsets-datacollector-jdbc-lib | |
#INSTALL AWS STAGES | |
RUN "${SDC_DIST}/bin/streamsets" stagelibs -install=streamsets-datacollector-aws-lib | |
#INSTALL AWS CREDENTIAL STAGES | |
RUN "${SDC_DIST}/bin/streamsets" stagelibs -install=streamsets-datacollector-aws-secrets-manager-credentialstore-lib | |
#INSTALL GROOVY STAGES | |
RUN "${SDC_DIST}/bin/streamsets" stagelibs -install=streamsets-datacollector-groovy_2_4-lib | |
# Copy files in $PROJECT_ROOT/resources dir to the SDC_RESOURCES dir. | |
COPY resources/ ${SDC_RESOURCES}/ | |
RUN sudo chown -R sdc:sdc ${SDC_RESOURCES}/ | |
COPY sdc-extras/ ${STREAMSETS_LIBRARIES_EXTRA_DIR}/ | |
COPY libs/streamsets-datacollector-jdbc-lib.tar ${STREAMSETS_LIBRARIES_EXTRA_DIR}/ | |
WORKDIR ${STREAMSETS_LIBRARIES_EXTRA_DIR}/ | |
RUN tar -xvf ${STREAMSETS_LIBRARIES_EXTRA_DIR}/streamsets-datacollector-jdbc-lib.tar && \ | |
rm -rf ${STREAMSETS_LIBRARIES_EXTRA_DIR}/streamsets-datacollector-jdbc-lib.tar && \ | |
chmod 644 streamsets-datacollector-jdbc-lib/lib/*.jar && \ | |
sudo chown -R sdc:sdc ${STREAMSETS_LIBRARIES_EXTRA_DIR}/ | |
#INSTALL CUSTOM STAGES | |
WORKDIR "${USER_LIBRARIES_DIR}/" | |
COPY libs/DynamoDB.tar . | |
RUN tar -xvf DynamoDB.tar && \ | |
rm -rf DynamoDB.tar && \ | |
chmod 644 DynamoDB/lib/*.jar | |
#COPY libs/customsns.tar . | |
#RUN tar -xvf customsns.tar && \ | |
# rm -rf customsns.tar && \ | |
# chmod 644 customsns/lib/*.jar | |
COPY libs/WriteToLog.tar . | |
RUN tar -xvf WriteToLog.tar && \ | |
rm -rf WriteToLog.tar && \ | |
chmod 644 WriteToLog/lib/*.jar && \ | |
chown -R "sdc:sdc" "${USER_LIBRARIES_DIR}/" | |
RUN ls -ld "${SDC_HOME}" | |
RUN ls -ld "${SDC_HOME}"/etc/ | |
RUN ls -ltr "${SDC_HOME}"/etc/ | |
#REPLACE POLICY FILLE | |
COPY policies/sdc-security.policy "${SDC_HOME}"/etc/sdc-security.policy | |
#REPLACE SETUP FILLE | |
COPY policies/setup.sh /tmp/setup.sh | |
#REPLACE CONFIG FILLE | |
COPY policies/config.properties "${SDC_HOME}"/etc/config.properties | |
#REPLACE SDC FILLE | |
COPY policies/sdc.properties "${SDC_HOME}"/etc/sdc.properties | |
#REPLACE CREDENTIAL FILLE | |
COPY policies/credential-stores.properties "${SDC_HOME}"/etc/credential-stores.properties | |
RUN cat "${SDC_HOME}"/etc/credential-stores.properties | |
#REPLACE LOG FILE | |
COPY policies/sdc-log4j.properties "${SDC_HOME}"/etc/sdc-log4j.properties | |
#REPLACE LDAP FILE | |
COPY policies/ldap-login.conf "${SDC_HOME}"/etc/ldap-login.conf | |
#REPLACE SDC-ENV FILE | |
COPY policies/sdc-env.sh "${SDC_HOME}"/libexec/sdc-env.sh | |
COPY docker-entrypoint.sh / | |
RUN chmod 755 /docker-entrypoint.sh | |
USER ${SDC_USER} | |
EXPOSE 18631 | |
#COPY docker-entrypoint.sh / | |
ENTRYPOINT ["/docker-entrypoint.sh"] | |
CMD ["dc", "-exec"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment