There are still obstacles to use the Cloud, even in a private Repository on Docker Hub.
You are walking on “thin ice” when you put important/confidential data to a Cloud solution.
Why is it necessary to have a CLM Server Image on Docker Hub?
We currently use a Git, Travis and Docker Integration, it means every time you commit changes to Git, Travis will run and perform some Tests. When you develop CLM software extensions this CI Solution is very powerful but you need a CLM Docker Image at Docker Hub.
Solution
A possible solution that I found is:
- Keep an empty CLM Server Docker Image at Docker Hub
- Pull this empty CLM Server with “docker pull…”
- And exchange the CLM Derby DB with a local Derby DB.
- Start the CLM Server.
This is possible because Derby DB, used in CLM Test Installations, is file system based. It means I could use the Backup/Restore mechanism to exchange the Derby DB.
Details about “Backing up and restoring the Derby database” are here.
Let me show you an example with a public Docker Image from Jim Ruehlin. We will use it to to fill the CLM/RTC Database (Derby DB) with Data and make a local Backup of the Derby DB.
First Steps (Create and Backup Derby)
- Open a Terminal. If you are working on LINUX you may have to type “sudo su -“. My example works on Mac OS.
- Login to Docker Hub with “docker login” (in case you are using a private Docker Repository)
- Run your “virgin” CLM (or RTC) Docker Image with “docker run -it -p 9443:9443 -v /Users/sh/dropins:/opt/IBM/JazzTeamServer/server/liberty/servers/clm/dropins jruehlin/clm603-rtc:latest /bin/bash”. The “-v /Users/sh/….” is used to convenient copy the Derby Backup file between your Host and the CLM/RTC Docker Image.
- Inside the RTC Docker Image go to the App Server Directory with “cd /opt/IBM/JazzTeamServer/server”
- Start the CLM/RTC Server with “./server.startup”
- Wait a little bit and open the Browser on your Host with “https://localhost:9443/rm”
- Now you can create a DNG Project Area based on confidential DNG Templates
- Don’t exit the running Docker Image!
- Open a second Terminal and type “docker ps” to get the Container ID of the running CLM/RTC Docker Image.
- Go to your first Terminal and stop the running App Server with “./server.shutdown”.
- Type in “cd conf” to change to the /opt/IBM/JazzTeamServer/server/conf directory
- Backup the CLM/RTC Derby DB with “tar cvpf clm.tar.gz */derby/*”
- Copy the resulting clm.tar.gz to the Host with “cp clm.tar.gz /opt/IBM/JazzTeamServer/server/liberty/servers/clm/dropins “
- Change to your second Terminal and go to the /Users/sh/dropins directory. If you want to store the tar file on Git you have to create file with a max of 25 MB. You can do this with “split -b 24m clm.tar.gz ” clm.tar.gz.part”
- Kill the running CLM Docker Image with going to your first Terminal an type “exit”. After this step all changes to the CLM Docker before are lost! But we the Tar File with the Backup of the Derby DB (containing the confidential Data).
Second Step (Restore the Derby DB to a new CLM/RTC Docker Image)
- Open a new Terminal and type “docker run -it -p 9443:9443 -v /Users/sh/dropins:/opt/IBM/JazzTeamServer/server/liberty/servers/clm/dropins jruehlin/clm603-rtc:latest /bin/bash”. In our case docker don’t pull a new CLM/RTC Docker Image from Docker Hub because we have an identical Image already.
- Type “cd /opt/IBM/JazzTeamServer/server/conf”
- Type “tar xpf /opt/IBM/JazzTeamServer/server/liberty/servers/clm/dropins/clm01.tar.gz” to restore the old Derby DB
- Start the App Server with “cd /opt/IBM/JazzTeamServer/server” and “./server.startup”
- Wait a little bit and open the Browser on your Host with “https://localhost:9443/rm”
- Your confidential DNG Project Area should be available and ready for testing.
A further “step by step” instruction with Travis and Docker Integration will come…
First travis.yml example
language: java
dist: trusty
network: bluezone
sudo: required
addons:
apt:
packages:
– iproute2
services:
– docker
before_install:
# can be encrypted with env var https://docs.travis-ci.com/user/environment-variables/
– docker login –username xxxx –password xxxx
– docker pull xxxx/clm603empty
– cat clm.tar.gz.parta* > clm.tar.gz
– docker run –name clm -td -p 9443:9443 xxxx/clm603empty
– docker cp clm.tar.gz clm:/opt/IBM/JazzTeamServer/server/conf
– docker exec -i clm /bin/bash -c ‘tar xzfp /opt/IBM/JazzTeamServer/server/conf/clm.tar.gz -C /opt/IBM/JazzTeamServer/server/conf’
– docker exec -i clm /bin/bash -c ‘/opt/IBM/JazzTeamServer/server/server.startup; tail -f /opt/IBM/JazzTeamServer/server/liberty/servers/clm/logs/console.log’
– docker ps -a
script:
– docker logs clm
– curl https://127.0.0.1:9443/jts -k
Useful Informations:
How to copy files to Docker Image