Resources
Step by step Wrapper for dtexec
under /opt/ssis/bin
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 #!/bin/bash while [[ $# -gt 0 ]]do key="$1 " case $key in /f) PACKAGE="$2 " shift ;; /de) PASSWORD="$2 " shift ;; /out) RESULT_FILE="$2 " shift ;; *) break ;; esac shift done SECONDS=0 CMD="/opt/ssis/bin/dtexec /f $PACKAGE /de $PASSWORD " EXECUTION_OUTPUT=$($CMD 2>&1) RESULT=`/bin/echo "$EXECUTION_OUTPUT " | /bin/grep -F "DTExec: The package execution returned" | /usr/bin/head -1` read res <<<${RESULT//[^0-9]/ } if [[ $res == 0 ]] ; then RESULT="SUCCESS" else RESULT="FAIL" echo "$EXECUTION_OUTPUT " fi OUTPUT="$RESULT $SECONDS " echo $OUTPUT | tee $RESULT_FILE
Dockerfile:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 FROM ubuntuCOPY mssql-server-is_xxx_amd64.deb . COPY openssl_1.0.2g-1ubuntu4_amd64.deb . RUN apt update \ && apt install -y ./openssl_1.0.2g-1ubuntu4_amd64.deb \ && apt install -y ./mssql-server-is_xxx_amd64.deb \ && mkdir -p /var/opt/ssis COPY ssis.conf /var/opt/ssis/ RUN SSIS_PID=Enterprise ACCEPT_EULA=Y /opt/ssis/bin/ssis-conf -n setup \ && rm -rf mssql-server-is_14.0.3015.40-1_amd64.deb \ && rm -rf openssl_1.0.2g-1ubuntu4_amd64.deb COPY dtexec . ENTRYPOINT ["./dtexec" ]
Build Docker image under the folder where Dockerfile is placed:
1 docker build -t ssis-docker .
Run the image:
1 docker run -v $(pwd ):/root ssis-docker /f /root/test.dtsx /de test /out /root/out.txt
I’ve uploaded the image to tomdu/ssis-docker .
~END~