diff --git a/docker.md b/docker.md new file mode 100644 index 0000000..df997d2 --- /dev/null +++ b/docker.md @@ -0,0 +1,61 @@ +# Using TSMPIPE as a Docker Microservice. +TSMPIPE works really well as a Docker microservice. While there are probably many use case scenarios for this, the simplest would be to backup all your Database Microservices (like MySQL). + +## To build TSMPIPE for Docker +1. Checkout TSMPIPE and build it. + + Download and install the TSM (SP) Clients from `ftp://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/client/`. + + Checkout and make the `tsmpipe` binary + + `make -f Makefile.linux64` + + If you built it, you should have a `tsmpipe` binary after the compile completes. +2. Create this Docker file + + ```Dockerfile +# NAME leenooks/tsmpipe +# VERSION 8.1.0 +# +FROM centos:7 +#RUN curl -SL ftp://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/client/v8r1/Linux/LinuxX86/BA/v812/8.1.2.0-TIV-TSMBAC-LinuxX86.tar | tar -C /tmp/ -xf - gskcrypt64-8.0.50.78.linux.x86_64.rpm gskssl64-8.0.50.78.linux.x86_64.rpm TIVsm-API64.x86_64.rpm && yum install -y /tmp/*rpm && rm -f /tmp/*rpm +RUN curl -SL http://{YOUR WEB SERVER}/CentOS/7/8.1.2.0-TIV-TSMBAC-LinuxX86.tar | tar -C /tmp/ -xf - gskcrypt64-8.0.50.78.linux.x86_64.rpm gskssl64-8.0.50.78.linux.x86_64.rpm TIVsm-API64.x86_64.rpm && yum install -y /tmp/*rpm && rm -f /tmp/*rpm +RUN ln -s /tsm/dsm.sys /opt/tivoli/tsm/client/api/bin64/ \ + && ln -s /tsm/dsm.opt /opt/tivoli/tsm/client/api/bin64/ \ + && ln -s /tsm/dsmcert.kdb /opt/tivoli/tsm/client/api/bin64/ \ + && ln -s /tsm/dsmcert.sth /opt/tivoli/tsm/client/api/bin64/ +# +COPY tsmpipe/tsmpipe /usr/bin +# +VOLUME [ "/tsm" ] +# +# Starting +ENTRYPOINT [ "/usr/bin/tsmpipe" ] + ``` + + **NOTE**: If you can, place your downloaded TSM (SP) Client tar file (from step 1) on a local web server - it'll save you downloading it a second time. If you dont have a local webserver, uncomment the first line `RUN curl ...` line, and comment out the second one above. +3. Build your Docker image + + `docker build -t leenooks/tsmpipe:8.1.0 .` +4. Create a directory to hold your `dsm.opt`, `dsm.sys` and if required, your SSL configuration. This will need to be mapped to the container when it starts using Docker's `-v` option. EG: `-v /tmp/tsmpipe:/tsm` +5. Check connectivity to your TSM (SP) Server + + `docker run --rm=true --hostname={NODE NAME} -iv /tmp/tsmpipe:/tsm leenooks/tsmpipe:8.1.0 -i` + + **NOTE**: You may need to set your password, use the `-p` switch. +6. If it all works OK, you should see a session dump starting with: + + ``` +Application Version: + TSMPIPE Version: 1.6.6 + TSMPIPE API Version: 8.1.0.0 + TSM Library: 8.1.2.0 +... + ``` +7. You can now STDOUT pipe from one container to another. + + For example: + + ``` +docker exec -it 2fbdec51b6c0 mysqldump --all-databases -FlK --skip-extended-insert --skip-dump-date | docker run --rm=true --hostname=test -iv /tmp/tsmpipe:/tsm leenooks/tsmpipe:8.1.0 -Bcs /test/test -f test -l 30000 -m md5 + ``` \ No newline at end of file