Article
· Apr 12, 2023 3m read

Launching InterSystems IRIS Community Edition Docker Image with User, Password and Namespace via Environment Variables

Hi Developers!

There is a recent update came for developer community images of InterSystems IRIS and IRIS For Health.

This release comes with Environment variables support.

Currently 3 variables are supported:

  • IRIS_USERNAME=user to create
  • IRIS_PASSWORD=with password
  • IRIS_NAMESPACE=create namespace if doesn't exist

Here is what you can do - see below.

Start iris with your username and password created:

docker run --rm --name iris-sql -d -p 9091:1972 -p 9092:52773  -e IRIS_PASSWORD=demo -e IRIS_USERNAME=demo intersystemsdc/iris-community

Launch SQL terminal irissqlcli or Dbeaver:

$ irissqlcli iris://demo:demo@localhost:9091/USER

 

Server:  InterSystems IRIS Version 2022.3.0.606 xDBC Protocol Version 65

Version: 0.5.1

[SQL]demo@localhost:USER> select $zversion

+---------------------------------------------------------------------------------------------------------+

| Expression_1                                                                                            |

+---------------------------------------------------------------------------------------------------------+

| IRIS for UNIX (Ubuntu Server LTS for ARM64 Containers) 2022.3 (Build 606U) Mon Jan 30 2023 09:07:49 EST |

+---------------------------------------------------------------------------------------------------------+

1 row in set

Time: 0.050s

[SQL]demo@localhost:USER>

And you can start IRIS terminal:

docker exec -it iris-sql iriscli
Node: fd7911f0b130, Instance: IRIS

USER>

And you can use IRIS_NAMESPACE variable to create a new namespace.

Let's stop and kill the container we created:

docker stop iris-sql

And launch a new one with namespace DEMO introduced:

docker run --rm --name iris-sql -d -p 9091:1972 -p 9092:52773 -e IRIS_PASSWORD=demo -e IRIS_USERNAME=demo -e IRIS_NAMESPACE=DEMO intersystemsdc/iris-community

Entering SQL terminal:

$ irissqlcli iris://demo:demo@localhost:9091/DEMO
Server:  InterSystems IRIS Version 2022.3.0.606 xDBC Protocol Version 65

Version: 0.5.1

[SQL]demo@localhost:DEMO> exit

Goodbye!

Entering IRIS terminal:

$ docker exec -it iris-sql iriscli -U DEMO
Node: 6c52cb612bc0, Instance: IRIS
DEMO>

And lets enter the IRIS terminal:

docker exec -it iris-sql iriscli -U DEMO

PS:

if you run the container locally you also can connect the SQL terminal via embedded python as:

$ docker exec -it iris-sql irissqlcli iris+emb:///DEMO
Server:  IRIS for UNIX (Ubuntu Server LTS for ARM64 Containers) 2022.3 (Build 606U) Mon Jan 30 2023 09:07:49 EST

Version: 0.5.2

[SQL]irisowner@/usr/irissys/:DEMO> select $username

+--------------+

| Expression_1 |

+--------------+

| irisowner    |

+--------------+

1 row in set

Time: 0.047s

[SQL]irisowner@/usr/irissys/:DEMO>

Credit goes to @Dmitry Maslennikov

DC Community images you can use

The latest stable releases of InterSystems IRIS:

  • intersystemsdc/iris-community - InterSystems IRIS Community Edition
  • intersystemsdc/irisheatlh-community - InterSystems IRIS For Health Community Edition 
  • intersystemsdc/iris-ml-community - InterSystems IRIS Community Edition with IntegratedML package
  • intersystemsdc/irishealth-ml-community - InterSystems IRIS Community Edition for Health with IntegratedML package

And the preview releases:

  • intersystemsdc/iris-community:preview
  • intersystemsdc/irisheatlh-community:preview
  • intersystemsdc/iris-ml-community:preview
  • intersystemsdc/irishealth-ml-community:preview

Happy coding!

UPDATE. Env variables without underscore are supported too: 

  • IRISUSERNAME=user to create
  • IRISPASSWORD=with password
  • IRISNAMESPACE=create namespace if doesn't exist
Discussion (1)1
Log in or sign up to continue