The admin client is an alternative way to connect to a Spectrum Protect Server, and is available with the Unix file client (also known as the BA client, where BA = Backup/Archive)
Using docker for the BA/Admin client is a simple way of deploying the client and keeping it up to date. When you `docker run`, if the client doesn't exist on the system you are running it from, it will automatically be pulled from (your defined) registry.
If you update the image in the registry, all you need to do is `docker pull` the new version (or just remove the current version with `docker rmi [IMAGE NAME]`) and the next run of `docker run` will pull the update image from the registry.
The steps below will help you create your own docker images of the BA client.
## Create your Dockerfile
Since IBM provides a Debian package for the BA Client, we'll use it. But you could use the RedHat one as well.
### Image preparation
```Dockerfile
FROM debian:stretch-slim
```
Next we need some additional dependencies to build the image
```Dockerfile
RUN apt-get update \
&& apt-get install -yyq curl procps \
&& rm -rf /var/lib/apt/lists/* /tmp/*
```
### BA Client Installation
As with building the server, it is better to download the package from the IBM website and have it available on a local webserver.
RUN /opt/tivoli/tsm/client/ba/bin/dsmcert -add -server spectrumprotect -file /opt/tivoli/tsm/client/ba/bin/cert256.arm
```
### Final Docker Image Parameters
Lastly, the baclient uses `/etc/adsm/` to store some information (like the auto login credentials if you are using `PASSWORDACCESS GENERATE`). Ideally you should use `-v [host path]:/etc/adsm` when you run the image.
```Dockerfile
VOLUME [ "/etc/adsm" ]
```
### Set your container timezone (optional)
If you want your running container to be in your timezone, then add this to your Dockerfile
```Dockerfile
# Set out local time
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
A complete Dockerfile is available [here](https://dev.leenooks.net/deon/spdocker/blob/client/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/spcient:8.1.x .`
If your final build is successful, you should see a Docker Image that is about 840MB.
```plain
REPOSITORY TAG IMAGE ID CREATED SIZE
ibm/spclient 8.1.8 8f5f34c8a38d 2 minutes ago 842MB
```
If you would like to access a pre-built image, you are welcome to from here: `registry.leenooks.net/deon/spdocker/client:8.1.8`
> * There is no reason to keep the container after it has been created - but removing the `--rm` will leave it around. It might make it a bit quicker to start next time by leaving it.
> * `--name=` is optional, but it gives your container a useful name
> * `--hostname=` gives your running a container a friendlier hostname - this is recommended if you are running the client (dsmc).
> * `-v` maps the /etc/adsm path (inside the container) to something on the host outside the container. This is recommended, especially if you want auto login.