Home  /  First Look: Docker Containers and InterSystems IRIS

First Look: Docker Containers and InterSystems IRIS
InterSystems: The power behind what matters   

This First Look guide is intended to introduce you to the fundamentals of using Docker containers with InterSystems IRIS™ by giving you a focused overview and a basic, hands-on example. You will learn the purpose, importance, and benefits of Docker containers, as well as the specifics of how InterSystems implements them. You will then deploy InterSystems IRIS in a container, make changes to the instance, and persist those changes.
For the full documentation on Docker containers, see the InterSystems Cloud Manager Guide, particularly the ICM Overview chapter and the appendix on Running InterSystems IRIS in Docker Containers.
Why Docker Containers are Important
Containers package applications into platform-independent, fully portable runtime solutions, with all dependencies satisfied and isolated. Docker containers, specifically, are ubiquitous: they can be found in public and private clouds and are supported on virtual machines (VMs) and bare metal. Docker has penetrated to the extent that all major public cloud Infrastructure as a Service (IaaS) providers support specific container services; in this way, organizations can reduce system administration costs by using Docker containers and letting the cloud provider handle the infrastructure.
Containers bring all of the following benefits:
Containers are poised to become a natural building block for applications, promoting application delivery and deployment approaches that are simpler, faster, more repeatable, and more robust.
How InterSystems IRIS Uses Containers
Because a Docker container packages only the elements needed to run a containerized application and executes the application natively, it provides standard, well-understood application configuration, behavior, and access. If you are experienced with InterSystems IRIS running on Linux, it doesn’t matter what physical, virtual, or cloud systems and OS platforms your Linux-based InterSystems IRIS containers are running on; you interact with them all in the same way, just as you would with traditional InterSystems IRIS instances running on Linux systems.
The following describes different aspects of how InterSystems IRIS uses containers.
Creating a Container from the InterSystems IRIS Image
Now that you have had an introduction to containers, this section will walk you through a simple, hands-on exercise. In this example, you will:
Because this example is intended to be brief, it does not delve into details about, for example, settings and security considerations. In production systems, there are many things you will need to do differently. The resources in the last section offer a more complete picture of using containers with InterSystems IRIS.
Basic Requirements
InterSystems IRIS is provided as a Docker image that includes everything you need. Therefore the only requirements for the Linux, macOS or Microsoft Windows system on which you launch InterSystems IRIS are that Docker CE 17.06+ is installed, with the Docker daemon running, and that the system is connected to the Internet.
It is necessary on some operating systems to change the default storage driver. For more information, see the Docker Storage Driver section in the InterSystems Cloud Manager Guide.
Identify the Docker Repository and Credentials
To download and run the InterSystems IRIS image, you need to identify the repository in which the image is located and the credentials you need to log into that repository.
InterSystems IRIS images are distributed as Docker tar archive files, available in the InterSystems Worldwide Response Center (WRC) download area. Your enterprise may have already have added these images to its Docker repository; in this case, you should get the location of the repository and the needed credentials from the appropriate IT administrator. If your enterprise has a Docker repository but has not yet added the InterSystems images, get the location of the repository and the needed credentials, obtain the tar archive files containing the InterSystems IRIS images from the WRC and add each of them to the repository using the following steps on the command line:
  1. Load an image from the tar archive file:
  2. Tag the image into your repository:
    For example:
    docker tag acme/iris:2018.1.0.583
  3. Log in to your repository:
    For example:
    docker login
    Pasword: **********
  4. Push the image to your repository:
    For example:
    docker push acme/iris:2018.1.0.583 
Creating a Container from the InterSystems IRIS Image
Once you have an InterSystems IRIS image in your organization’s repository or on your local machine, you are ready to begin the example.
  1. Pull the image from your repository:
    For example:
    docker pull acme/iris:2018.1.0.583
  2. Create and start a new container called iris:
    docker run -d --name iris acme/iris:2018.1.0.583
    You can enter docker ps to see your container in the list with a STATUS of Up.
  3. Create a Bash session in the container:
  4. For security reasons, the predefined user accounts in the InterSystems IRIS instance in an image provided by InterSystems have random, unrecorded passwords. Before starting and connecting to the instance, change the password by entering the following:
    echo <password> > /password.isc
    $ISC_PACKAGE_INSTALLDIR/dev/Cloud/ICM/ /password.isc
    This sets the password for the predefined accounts to password.
    For more information on predefined user accounts in InterSystems IRIS, see the “Important” box in the Creating InterSystems IRIS Docker Images section of the InterSystems Cloud Manager Guide; in particular, this section discusses automating the password-change process with a script.
  5. Start InterSystems IRIS:
    ccontrol start IRIS
  6. Connect to the instance:
    csession IRIS
  7. Log in with the credentials from above:
    Username: _SYSTEM
    Password: password
Change the Instance and Commit the Container
  1. Add a global to the database, for example:
     set ^newglobal="sample"
    Write the global to ensure that it exists:
     zw ^newglobal
  2. Enter halt to halt the InterSystems IRIS Terminal, then exit to exit the shell.
  3. Stop the container:
  4. Create a new container image:
    For example:
    docker commit iris my-iris:v1
    Verify that you have a new image by running:
Run an Instance from the New Image
  1. Create and start a container from the new image:
    where image_name:version is the name and tag you specified in the previous step.
    For example:
    docker run -d --name iris2 my-iris:v1
  2. Create a Bash session:
    docker exec -it iris2 bash
  3. Log in to InterSystems IRIS:
    csession IRIS
    and enter your credentials. Note that the instance remembers your credentials.
  4. Write the global that you created previously and ensure that it is correct:
     zw ^newglobal
More Information about Docker Containers
At this point, you are ready to continue exploring what Docker has to offer. Use the documentation and resources below to dive deeper into containers and InterSystems IRIS.