Article
· Apr 15, 2022 3m read

Adding VSCode into your IRIS Container

Adding VSCode into your IRIS container

One of the easiest ways to setup repeatable development environments is to spin up containers for them. I find that when iterating quickly, it was very convenient to host a vscode instance within my development container. Thus, I have created a quick container script to add a browser-based vscode into an IRIS container. This should work for most 2021.1+ containers. My code repository can be found here

InterSystems IRIS container with vscode and pre-connected

Cred Value
User _SYSTEM
Password SYS

image

Overview

This project creates an IRIS container with a hosted (web-based) version of vscode available in the same IRIS container. This provides:
* Same container code editing
* Pre-connection to the container's IRIS instance
* Links from the Management Portal
* Auto starting IDE with the container

Quick Start

  1. Download or git clone https://github.com/nickmitchko/Hosting-vscode-in-a-container.git
  2. In the root of the project, run docker build . -t vscode-irishealth-ml:latest --no-cache
  3. Run docker-compose up
    • Not using docker compose? See here
  4. Navigate to Management Portal
  5. Login with the user and password near the top of this guide
  6. Click VSCODE Link on the favorites pane
  7. When prompted use the same password in vscode to connect to the IRIS instance.
# New folder for project
mkdir vscode-iris
cd vscode-iris

# Clone repo here
git clone https://github.com/nickmitchko/Hosting-vscode-in-a-container.git .

# Build image
docker build . -t vscode-irishealth-ml:latest --no-cache

# Only Run (A) or (B)
#
# (A) Run compose file
docker-compose up
# OR (B) if you want a daemon
docker-compose up -d

Adding Persistence

If you want a persistent iris instance, un comment lines 16-20 in docker-compose.yml file. This adds a persistent storage mount to the container.

    volumes:
    - "./durable/:/durable/"
    environment:
    - ISC_DATA_DIRECTORY=/durable/iconfig

Changing the base image

This image is built upon the InterSystems Developer Community zpm images (found here). These images include the zpm command which allows us to install from the package repository easily, but only has a community license of 90 days.

The image tag used for builds is:

FROM intersystemsdc/irishealth-ml-community:latest

If you want to change the image, change the first line of the docker file to your desired image tag (either a custom IRIS instance or a supported one). For example:

FROM containers.intersystems.com/intersystems/irishealth-community:2021.2.0.651.0

No Docker-Compose

If you're not using docker compose, you can still run the container as follows:

# After building the container
# --after command is required
docker run --name vscode -d \
    --publish 1972:1972 \
    --publish 52773:52773 \
    --publish 51773:51773 \
    --publish 53773:53773 \
    --publish 8080:8080 \
    --publish 8888:8888 \
    vscode-irishealth-ml:latest \
    --after "/bin/bash /install/boot.sh"
Discussion (5)3
Log in or sign up to continue