docs.intersystems.com
Home / Creating and Running InterSystems IRIS Docker Containers / The iris-main Program


InterSystems: The power behind what matters   
Search:  


The iris-main Program
There are several requirements an application must satisfy in order to run in a Docker container. The iris-main program was developed by InterSystems to enable the InterSystems IRIS and its other products to meet these requirements.
The main process started by the docker run command, called the entrypoint, is required to block (that is, wait) until its work is complete. In the case of a long-running entrypoint application, this process should block until it's been intentionally shut down.
InterSystems IRIS is typically started using the iris start command, which spawns a number of InterSystems IRIS processes and returns control to the command line. Because it does not run as a blocking process, iris is unsuitable for use as the Docker entrypoint application.
The iris-main program solves this problem by starting InterSystems IRIS and then continuing to run as the blocking entrypoint application. The program also gracefully shuts down InterSystems IRIS when the container is stopped, and has a number of useful options. To use it, add the iris-main binary to a Dockerfile and specify it as the entrypoint application, for example:
ADD host_path/iris-main /iris-main
ENTRYPOINT ["/iris-main"]
Docker imposes these additional requirements on the entrypoint application:
In addition to addressing these issues discussed in the foregoing, iris-main provides a number of options to help tailor the behavior of InterSystems IRIS within a container. The options provided by iris-main are shown in the list that follows; examples of their use are provided in Running InterSystems IRIS Containers.
Options for iris-main appear after the image name in a docker run command, while the Docker options appear before it. As with the docker command, the options have a long form in which two hyphens are used and a short form using only one.
Note:
Options for iris-main appear after the image name in a docker run command, while the Docker options appear before it. As with the docker command, the options have a long form in which two hyphens are used and a short form using only one.
Option Description Default
-i instance,
--instance=instance
Sets the name of the InterSystems IRIS instance to start or stop. IRIS
-d 1|0,
--down=1|0
Stops InterSystems IRIS (using iris stop) on container shutdown (1 – true, 0 – false) 1 (true)
-u 1|0,
--up=1|0
Starts InterSystems IRIS (using iris start) on container startup (1 – true, 0 – false) 1 (true)
-s 1|0,
--nostu=1|0
Starts InterSystems IRIS in single-user access mode (1 – true, 0 – false) 0 (false)
-l log_file,
--log=log_file
Specifies a log file to redirect to standard output for monitoring using the docker logs command. none
-k key_file,
--key=key_file
Copies the specified InterSystems IRIS license key to the mgr/ subdirectory of the install directory. none
-p password_file,
--password-file password_file
Changes the InterSystems IRIS password to the contents of the file and then deletes the file. (InterSystems IRIS 2018.1.2 containers only.) none
-b command,
--before command
Sets the executable to run (such as a shell script) before starting InterSystems IRIS none
-a command,
--after command
Sets the executable to run after starting InterSystems IRIS none
-e command,
--exit command
Sets the executable to run after stopping InterSystems IRIS none
--create=command
Execute a custom shell command before any other arguments are processed
 
--terminate=command
Execute a custom shell command after any other arguments are processed
 
--version Prints the iris-main version N/A
-h,
--help
Displays usage information and exits N/A


View this article as PDF
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-03-17 22:37:05