You can run the Forge CLI in a development container, which provides a consistent and isolated environment pre-configured with the dependencies you need to build Forge apps. This guide explains how to run the Forge CLI in the development container using Visual Studio Code or IntelliJ IDEA.
A development container (or dev container) is a Docker container configured to provide a full-featured development environment. Development containers are used to separate tools, libraries, or runtimes needed for development from your local machine.
The development container includes:
To use development containers, create a .devcontainer.json
configuration file. Here is an example configuration file which pulls the latest version of the provided Docker for the Forge CLI container:
1 2{ "name": "Atlassian Forge Development Container Sample Config", "image": "atlassian/forge-devcontainer:latest", "features":{}, "customizations": { "vscode": { "extensions": [ "dbaeumer.vscode-eslint", "esbenp.prettier-vscode" ], "settings": { "terminal.integrated.shell.linux": "/bin/bash" } } }, "remoteUser": "node" }
To pull the Docker image directly, run:
1 2docker pull atlassian/forge-devcontainer:latest
.devcontainer.json
file with the above configuration..devcontainer.json
file in VS Code. VS Code will detect the dev container configuration and prompt you to reopen the folder in a container..devcontainer.json
file with the above configuration..devcontainer.json
file. IntelliJ IDEA will detect the dev container configuration and prompt you to open the project in a container.You must use the terminal in your IDE to run Forge CLI commands.
Do not use forge login in a development container. Instead, set the FORGE_EMAIL
and FORGE_API_TOKEN
environment variables in your shell configuration. For more details, see Using environment variables to log in.
To create your own Forge app from scratch:
1 2forge create
1 2cd your-app-name
1 2forge deploy
1 2forge install
For more information on developing with Forge, see the Forge documentation.
If you're working in a corporate environment with a proxy, you'll need to configure both Docker and the dev container to work with your proxy. Follow these instructions for Linux and Windows Subsystem for Linux (WSL). For more details, see Use the Forge CLI on a corporate network.
Replace http://proxy.example.com:8080
with your actual corporate proxy URL in the examples below.
Create or edit the Docker daemon configuration file:
1 2sudo mkdir -p /etc/systemd/system/docker.service.d sudo nano /etc/systemd/system/docker.service.d/http-proxy.conf
Add the following content, replacing the proxy URLs with your corporate proxy details:
1 2[Service] Environment="HTTP_PROXY=http://proxy.example.com:8080" Environment="HTTPS_PROXY=http://proxy.example.com:8080" Environment="NO_PROXY=localhost,127.0.0.1,.example.com"
Restart the Docker daemon:
1 2sudo systemctl daemon-reload sudo systemctl restart docker
Verify the configuration:
1 2sudo systemctl show --property=Environment docker
Create or edit the .wslconfig
file in your Windows user directory:
1 2[wsl2] kernelCommandLine = "sysctl.net.ipv4.tcp_keepalive_time=60 net.ipv4.tcp_keepalive_intvl=60 net.ipv4.tcp_keepalive_probes=6"
In your WSL distribution, create or edit the Docker daemon configuration:
1 2sudo mkdir -p /etc/docker sudo nano /etc/docker/daemon.json
Add the following content, replacing the proxy URLs with your corporate proxy details:
1 2{ "proxies": { "default": { "httpProxy": "http://proxy.example.com:8080", "httpsProxy": "http://proxy.example.com:8080", "noProxy": "localhost,127.0.0.1,.example.com" } } }
Restart Docker:
1 2sudo service docker restart
Rate this page: