Create and Run a Native Docker Container

Following is the upgrading procedure: 
casp1032
: OpenShift specific ssh scripts introduced in 10.3.2, may stall installation with native docker, but function as expected with OpenShift. The ssh script is not relevant for the native docker. To resolve this issue, users are requested to do an "exit" at the container prompt when it gets stalled, so that flow resumes to caller script, which is "spectrum_setup.sh".
Create and Run a Native Docker Container
To create the following docker containers, run the following command(s):
  • To create an MLS container: 
    docker run -e LANDSCAPE_HANDLE=128 -e IS_MLS=yes -e ROOT_PASSWORD=<pwd> -it spectrum-ss-image
  • To create Non-MLS/LS containers:
    docker run -e LANDSCAPE_HANDLE=64 -e IS_MLS=no -e ROOT_PASSWORD=<pwd> -e MAIN_LOCATION_SERVER=<mlsconname> -e MAIN_LOCATION_SERVER_IP=<mlsipaddress> -it spectrum-ss-image
  • To create a OneClick Server container:
    docker run -e LANDSCAPE_HANDLE=128 -e ROOT_PASSWORD=<pwd> -e MAIN_LOCATION_SERVER=<mlsconname> -e MAIN_LOCATION_SERVER_IP=<mlsipaddress> -e TOMCAT_PORT=8080 -p 9090:8080 -it spectrum-one-click-server-image
    : LANDSCAPE_HANDLE is the environment variable and 128 is the value. Mention all the environment variables with their desired values for Spectrum installation to work.
  • To get the container id, run the following command: 
    docker ps -a
  • To log in to the container and to either start or stop the SpectroSERVER or to run any such operation, run the following the command: 
    docker exec -it <container_id> /bin/bash
  • Access the OneClick page using the url:  http://hostvmname:9090/spectrum (here 9090 is the port mapping).
    On the OneClick page, if the Non-MLS Locations Servers, do not appear, add a Non-MLS hostname, IP as part of /etc/hosts of MLS.
Upgrade 
Following is the upgrading procedure
  1. Create a Persistent Volume on a Linux host using the Native Docker Engine by executing the following command: 
    docker volume create my-vol
    docker volume ls
    docker volume inspect my-vol
    [
    {
    "Driver": "local",
    "Labels": {},
    "Mountpoint": "/var/lib/docker/volumes/my-vol/_data", >>> Location of PV on hostvm
    "Name": "my-vol",
    "Options": {},
    "Scope": "local"
    }
    ]
  2. Create a container and mount Persistent Volume onto a folder in a container. In the SS-Image there is a
    /data folder
     that is already created. Use that as a mount location. Docker command to create a container with mounting Persistent Volume, is as follows: 
    • To create a MLS SpectroSERVER only container, execute the following command: 
      docker run -it --name ls1 -v my-vol:/data -e LANDSCAPE_HANDLE=128 -e IS_MLS=yes -e ROOT_PASSWORD=<root-pwd> -e PERSISTENT_LOCATION=spectrum/mls1 ss-image-crash-103    
      Here map my-vol to /data location in container. The /data of a container is mounted onto /var/lib/docker/volumes/my-vol/_data of HOST VM.
    • To create a Non-MLS SpectroServer only container, execute the following command: 
      docker run -e LANDSCAPE_HANDLE=64 -e IS_MLS=no -e ROOT_PASSWORD=<pwd> -e MAIN_LOCATION_SERVER=<mlsconname> -e MAIN_LOCATION_SERVER_IP=<mlsipaddress>  -e PERSISTENT_LOCATION=spectrum/ls1 -it spectrum-ss-image
    • To create a SpectroSERVER with an OCS container, execute the following command: 
      docker run -it --name ls1 -v my-vol:/data -e LANDSCAPE_HANDLE=128 -e IS_MLS=yes -e ROOT_PASSWORD=<pwd> -e PERSISTENT_LOCATION=spectrum/ls1 -e TOMCAT_PORT=8080 -p 9090:8080 isl-dsdc.ca.com:5000/tools-ca-com/ssocsbothpv
  3. Run the SSdb backup.sh script, copying the SSdb onto a Persistent Volume.
  4. Upgrade by killing the current container and creating a new one with the same image or with an image with changes. Mention the same persistent volume during a new container creation. A new container is created with the saved SSdb.
Troubleshooting
Q. During installation, Docker throws an error, even after updating the docker with the ‘yum update’ command. 
A.Follow these steps:
  1. Remove all previous native docker installation remnant by running command:
    [[email protected] ~]# rpm -aq | grep docker
    docker-common-1.10.3-59.el7.centos.x86_64
    [[email protected] ~]# yum remove docker*
  2. Find container-selinux: 
    [[email protected] ~]# rpm -qa | grep container-selinux
    container-selinux-1.10.3-59.el7.centos.x86_64
  3. Ensure container-selinux is not used by anything else and remove it using the commands: 
    [[email protected] ~]# rpm -q --whatrequires container-selinux-1.10.3-59.el7.centos.x86_64
    no package requires container-selinux-1.10.3-59.el7.centos.x86_64
    [[email protected] ~]# yum remove container-selinux