(These instructions as based on Spectrum Protect 8.1.1. References to *SP* means Spectrum Protect.)
> **NOTES**
> * Depending how your storage volumes are provisioned to running containers, you may need to increase the "default size" of a provisioned volume.
For example if your storage driver is `devicemapper` then the default volume size `Base Device Size` may be 10GB, which wont be enough for a SP installation. You will need to increase it to at least 15GB - details on how to do that are outside of the scope of this document.
> * Also make sure your host has sufficient memory to perform the build - SP requires at least 12GB of RAM to pass the installation logic.
I actually perform the build on an iMac with 16GB of memory allocated to Docker. It is also using the `overlay` storage driver, which means the size of the volume the build container gets is the available free capacity of my /Users mount point.
> * The accompanying files for this build are available in my [gitlab](http://dev.leenooks.net/deon/spdocker/tree/master)
> * And lastly, most importantly, running SP in a container is **not officially supported by IBM** - so you cannot make a help-desk call about having problems.
Technically it should work without problems, but if you are experiencing a problem, be prepared to recreate your environment on a physical host and validate that your problem still exists (and thus not a result of Docker or the implementation on Docker).
Next we need to install some dependencies - these are documented in the [Knowledge Center](https://www.ibm.com/support/knowledgecenter/SSEQVQ_8.1.4/srv.install/r_srv_lnx_sysreq_inst_x-linux.html) as a requirement for running SP on Linux. You might like to check to make sure these are still all that is required for newer releases of SP.
<small>**NOTE**: During the installation of SP, it tests to make sure it is running on RedHat Linux by testing the existence of an RPM package `redhat-release`. The redhat-release installed on line 1 is a fake RPM package - it installs no files, but just emulates the existence of that required RPM package.</small>
Now copy in our silent install configuration files. These files are based on the silent install XML files that come on the installation media. Some details on these files are also in the [Knowledge Center](https://www.ibm.com/support/knowledgecenter/SSEQVQ_8.1.4/srv.install/t_srv_inst_silently-linux.html)
<small>**NOTE**: We only include the silent install configuration files here - not the installation media, otherwise the size of the resulting Docker image is too big. Current versions of `docker build` do provide the ability to "flatten" the resulting container, but those instructions are outside the scope of this tutorial.</small>
* This is an "new install" (lines 1-6) then followed by an "upgrade" (lines 7-11). The reason for the new install first, is that the Spectrum Protect license files and license libraries are not available in upgrades (from Fix Central). So you'll need to install from your downloaded media from Passport Advantage, and then upgrade it to the latest release from Fix Central.
If you sourced your installation media from Passport Advantage, then the license files and libraries are probably in that installation media, so you only need to run lines 1-6.
* To avoid the resulting Docker Image being too large, we download the installation media from a web server (Line 3) and then delete it after it has been expanded (line 4). We also do the same for up upgrade package (lines 8 & 9).
* Lines 5 and 10 are silent installation methods for install SP and applying updates.
* Lines 6 and 11 delete any installation files to reduce the size of the resulting Docker Image.
<small>**NOTE**: You can set these according to your enterprise policy. `USERDIR` will ultimately need to be persistent storage using your favourite storage provisioning methodology. I generally host mount when starting the container using `-v /host/path/user:/tsm` and it works well. I have used some 3rd party persistent storage offerings, however, they often have not worked. While I haven't explored in detail why not, I suspect it is because of Direct IO calls being made by DB2 and those 3rd party offerings not supporting those system calls.</small>
Copy some default Server configuration files in place
```Dockerfile
COPY dsmserv.opt tsmdbmgr.opt ${USERDIR}/
COPY dsm.sys /opt/tivoli/tsm/server/bin/dbbkapi/
RUN chmod a+r /opt/tivoli/tsm/server/bin/dbbkapi/dsm.sys
```
We'll now do some post installation setup, first create the DB2 instance for our user and change the default directory for the database to be the same as the instance directory for the server.
```Dockerfile
RUN /opt/tivoli/tsm/db2/instance/db2icrt -a server -s ese -u ${USER} ${USER} && \
A complete Dockerfile is available [here](http://dev.leenooks.net/deon/spdocker/blob/master/Dockerfile) if you need one as a starting point. Once you have your images loaded on a web server, and the supporting build files run `docker build -t ibm/spectrumprotect:8.1.x .`
Now that your container is built, you'll want to start it a specific way, depending on whether you are starting a clean new instance of SP, or an existing instance. Those details are [here](firstrun.html).