Skip to content

Dev Container Support

With the launcher v3.5.11 release, the launcher supports the creation of sandbox environments. Sandbox environments are dev-container based workspaces, with dmla component updates disabled.

To build a sandbox, use the sandbox command of the DMLA launcher. The command supports the explicit specification of component versions to be used, with the following arguments:

--runtime <VERSION> Sets the runtime version to use in the sandbox --bootstrap <VERSION> Sets the bootstrap version to use in the sandbox --launcher <VERSION> Sets the launcher version to use in the sandbox --graal <VERSION> Sets the GraalVM version to use in the sandbox --code <VERSION> Sets the VS Code extension version to use in the sandbox

The --create option should never be executed on the host, as it is overwrites the local configuration with the sandbox parameters.

To create a sandbox container, execute the dmla sandbox --tag <container tag> command. This generates the dockerfile, a temporary configuration for use during installation, and downloads the specified linux-based version of the DMLA launcher.

With these resources generated, the container is ready to be built using docker build . -t <container tag>. Expect the build to take a while, as GraalVM will be installed in the container during the build.

Once the build is ready, create a .devcontainer directory in the workspace you wish to use with the sandbox, and create a devcontainer.json file with the following configuration:

// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
    "name": "<Sandbox name>",
    "image": "<Container tag here>",
    "customizations": {
        "vscode": {
            "extensions": [
                "/home/dmlauser/.dmla/extensions/extension.vsix"
            ]
        }
    },
    "containerUser": "dmlauser",
    "remoteUser": "dmlauser"
}

Once this file is ready, your sandbox should be ready to use.

On the user's side no setup is required other than installing the official dev-containers extension from VS Code marketplace. With the plugin installed, VS Code will prompt the user to reload the workspace in the dev container, or the Dev Containers: Reopen in Container can be used to load the workspace within the container.

No port-forwarding or environment setup is necessary, but an additional experiment involving code-server is underway, as this could reduce our dependencies to docker (i.e. even VS Code would not be required, as code-server provides an environment that runs in the browser).

An experimental repository containing the workspace is available: gergelygembela/dmla-codespaces. Wile the repository could/will be used as a starting point for public releases, please not share or redistribute the contents of this repository, its sole purpose is to provide a workspace for testing!

GitHub Codespaces

The should work in GitHub codespaces, accessible from the upper-right green code menu on GitHub.

Known issues

The VS Code extension cannot be updated using the launcher until the code-server alias is created. This requires further testing, or preferably a dev-container specific workaround built-in to the launcher.