In this guide, we'll walk through creating a Docker image for TDI. This image will contain an installed TDI server that will serve as the base image for a TDI for Connections image.
-
On the Docker host system, create a directory to hold the image artifacts. For this guide, we'll use ~/images/tdi/base.
-
Change to the ~/images/tdi/base directory.
-
Download the Dockerfile from https://raw.githubusercontent.com/chscott/ConnectionsDocker/master/tdi/base/Dockerfile.
$ curl -L -O -J -s -S -f https://raw.githubusercontent.com/chscott/ConnectionsDocker/master/tdi/base/Dockerfile
-
Create the ~/images/tdi/base/setup directory.
-
Change to the ~/images/tdi/base/setup directory.
-
Download entrypoint.sh from https://raw.githubusercontent.com/chscott/ConnectionsDocker/master/tdi/base/entrypoint.sh.
$ curl -L -O -J -s -S -f https://raw.githubusercontent.com/chscott/ConnectionsDocker/master/tdi/base/entrypoint.sh
-
Make the entrypoint.sh script executable.
$ chmod u+x entrypoint.sh
-
At this point, you should have the following directories/files:
- ~/images/tdi/base/Dockerfile
- ~/images/tdi/base/setup/entrypoint.sh
-
Change to the ~/images/tdi/base directory.
-
Build the image.
$ docker build -t tdi/7.1.1.6/preinstall .
-
Confirm the image was created successfully.
$ docker image ls
-
Change to the home directory and download env-tdi-base.txt from https://raw.githubusercontent.com/chscott/ConnectionsDocker/master/tdi/base/env-tdi-base.txt.
$ curl -L -O -J -s -S -f https://raw.githubusercontent.com/chscott/ConnectionsDocker/master/tdi/base/env-tdi-base.txt
-
Open env-tdi-base.txt and update the URLs for your environment. These are the locations at which the TDI install and fixpack packages plus the required DB2 JARs are hosted in your environment. These files will be downloaded during installation.
-
Run a container based on the new TDI base image.
$ docker run --name tdi_install --env-file ~/env-tdi-base.txt -it tdi/7.1.1.6/preinstall
-
Run the entrypoint.sh script and confirm TDI installs successfully.
$ ./entrypoint.sh
-
Delete the /setup directory inside the container. This directory holds installation artifacts that are not needed moving forward. Deleting them now reduces the size of the image we are about to create.
$ cd / $ rm -f -r /setup
-
Exit the container shell.
$ exit
-
Commit the changes made to the tdi_install container to a new image.
$ docker commit tdi_install tdi/7.1.1.6/base
-
Confirm the image was created successfully.
$ docker image ls
-
Remove the tdi_install container, as it is no longer needed.
$ docker container rm tdi_install
-
Remove the preinstall image, as it is no longer needed.
$ docker image rm tdi/7.1.1.6/preinstall
-
Delete env-tdi-base.txt, as it is no longer needed.
$ rm ~/env-tdi-base.txt
You have now successfully created the TDI base image.