Skip to main content

Run a Container from the InterSystems IRIS Image

Run a Container from the InterSystems IRIS Image

Once you have made the InterSystems IRIS image available on your local machine and have identified the external storage location and placed your license key on it, you are ready to use the docker run command to create and start a container. The docker run command actually combines three separate commands, as follows:

  • docker pull — Downloads an image if it is not already present locally.

  • docker create — Creates a container from the image.

  • docker start — Starts the container.

Each of these commands is useful separately, for various purposes in different contexts. For more information, see Docker run referenceOpens in a new tab in the Docker documentation.

A sample docker run command follows; all of its options are explained in the accompanying text. Note that options to the docker run command appear on the command line before the image specification, while options to the InterSystems iris-main program come after. (In this case, the pull command that is part of docker run is not needed, as you have already downloaded the iris image you want to use.)

docker run --name iris
  --detach
  --publish 1972:1972
  --volume /nethome/pmartinez/iris_external:/external
    intersystems/iris:latest-em
  --key /external/iris.key

  • --name container_name

    Specifies the name of the container, which you can use to refer to the container in other Docker commands, for example docker stop container_name when you want to stop the container.

  • --detach

    Runs the container in the background (and displays the container’s unique ID).

  • --publish host_port:container_port

    Publishes a port within the container to a port on the host so that entities outside the container (on the host or on other machines) can contact the program running in the container. For example, an InterSystems IRIS instance’s superserver port, which is used for applications connections, data ingestion, and more is 1972. If this port inside the container is published to a port on the host, the instance’s superserver can be reached using the host’s port, for example in this JDBC connection string: jdbc:IRIS://container-host:1972/namespace.

    --volume external_storage_path:internal_volume

    Mounts an external storage location accessible by the container as a storage volume inside the container. For information about which storage locations can be mounted in this way and Docker configuration that may be required, see VolumesOpens in a new tab in the Docker documentation.

    Important:

    The host file system location you mount and specify for this purpose must be writable by user 51773Opens in a new tab. (You will most likely need root privileges to effect this.)

    InterSystems does not support mounting NFS locations as external volumes in InterSystems IRIS containers.

  • repository/image:tag

    Specifies the image to be pulled and used to create a container (see Download the InterSystems IRIS Image). Use the docker images command to list available images and make sure you are specifying the right one.

  • --key license_key_path

    An iris-main option that identifies the InterSystems IRIS license key to be installed in the instance in the container; this location must be on a mounted volume (see Add the License Key to the External Storage Location). When the container is running, iris-main continuously monitors the staged license key for changes; if any change is detected, it is copied to the current /mgr/ directory and activatedOpens in a new tab.

Use the preceding sample and explanations to construct your own docker run command and execute it on the command line. When the command has completed, use the docker ps command to see your container in the list with a status of Up.

$ docker run --name iris --detach --publish 1972:1972
    --volume /nethome/pmartinez/iris_external:/external
    intersystems/iris:latest-em
    --key /external/iris.key
426d4a511d6746d89ec2a24cf93b29aa546ea696b479a52210d37da4c6d04883
$ docker ps
CONTAINER ID  IMAGE                             COMMAND                 CREATED        STATUS       
426d4a511d67  intersystems/iris:latest-em  "/iris-main --key ..."  5 seconds ago  Up 3 seconds 
    PORTS                     NAMES
    0.0.0.0:1972->1972/tcp  iris
Note:

The --key option is not needed with the InterSystems IRIS Community Edition image (see Download the InterSystems IRIS Image), which comes with a free built-in license.

If the image is not yet present locally but is in your organization’s repository, Docker pulls (downloads) the image before creating and starting the container.

As shown in the example, after creating the container, Docker outputs the UUID long identifier; the first 12 characters make up the UUID short identifier, which is used to identify the container in other output, for example from the docker ps command.

FeedbackOpens in a new tab