Dev Container CLI
The Dev Container CLI provides a way to build Dev Containers directly on the client’s infrastructure. It offers flexible and customizable builds through local scripts, supporting various environments and workflows—such as CI pipelines and remote development setups. This tool automates the entire Dev Container preparation process.
You can download the Dev Container CLI as a ZIP archive containing a JAR file and run it directly from the terminal.
Prerequisites
Before configuring the Dev Container CLI, ensure the following prerequisites are met:
The ZIP distribution requires JDK 17 or newer to be installed.
The project for which you want to build a Dev Container must contain a
devcontainer.jsonfile.
Configure CLI
Install and run Dev Container CLI
Download and unpack the
.zipfile.Alternatively, you can use the following command:
curl -f -L -o intellij-devcontainers-cli.zip "https://jb.gg/intellij-devcontainers-cli.zip/latest"Check the following example link to the deployed distribution:
https://download.jetbrains.com/resources/intellij/dev-containers/243.19420.43/intellij-devcontainers-cli.zipIn the terminal, locate the
ijcdevscript file.Run the script from the current directory using the following command:
./ijdevcThe
ijdevcscript file contains the following parameters:SOURCE: a directory to a project where thedevcontainer.jsonfile is located.config: defines a path to adevcontainer.jsonfile.format: structures the output for clearer representation.
Build Dev Container
Execute the script with the
configparameter and a local path to the project'sdevcontainer.jsonfile.Run the following command:
./ijdevc --config /full/path/to/project/.devcontainer/devcontainer.json /full/path/to/projectCheck the following example:
./ijdevc --config /Users/jetbrains/spring-petclinic/.devcontainer/devcontainer.json /Users/jetbrains/spring-petclinicThe output of the CLI operation is a Dev Container artifact with the project sources inside, along with all necessary tooling for its build.
Check the following detailed information of the prepared Dev Container, along with its ID:
