Using the Extension with Visual Studio Code Dev Containers
Visual Studio Code Dev Containers offer self-contained, reproducible development environments. These Docker containers are configured for a full development experience, containing the necessary tools, runtimes, and libraries. For more information, see Create a Dev Container.
This section provides three approaches to configure a Dev Container for Flogo app development. These approaches apply to various Docker Desktop configurations. You can configure the foundational Docker image and preserve the environment within a personalized image.
Docker Desktop Configuration
Before proceeding, ensure that your Docker Desktop configuration aligns with your requirements, as it affects file access and performance.
Configuration 1: WSL-2-Disabled, Hyper-V-Enabled, File-Sharing-Enabled
-
Hyper-V is used as the virtualization backend.
-
Windows Subsystem for Linux (WSL) is disabled.
-
File sharing is enabled to provide container access to Windows files.
Configuration 2: WSL-2-Enabled
-
WSL 2 is used as the virtualization backend.
-
File system integration between Windows and Linux-based WSL 2 environment.
Prerequisites
-
Microsoft Visual Studio Code (VS Code) with the Dev - Containers extension
-
Docker Desktop
-
Linux build (
.vsix
) of TIBCO Flogo® Extension for Visual Studio Code
-
A project folder (can be empty) to initialize the Dev Container.
Approach 1: Using a Predefined Microsoft Base Image
To set up a Dev Container using a predefined Microsoft base image available in VS Code, perform the following steps:
-
Open your Flogo project (or an empty folder) in Visual Studio Code.
-
Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and select Dev Containers: Open Folder in Container.
.devcontainer
folder with a devcontainer.json
file does not exist, you are prompted to create one.-
Choose From a definition to select a configuration. Options include Docker in Docker devcontainers, Docker outside of Docker devcontainers, or Docker outside of Docker Compose devcontainers.
-
Optional: Select the Install OSS Moby build instead of Docker CE option.
-
Select and enable features, such as Go devcontainers, to install the Go language and the related utilities inside the container. For example, Microsoft's Dev Container .mcr.microsoft.com/devcontainers/base:bullseye.
Based on the configuration and your selections, a .devcontainer
folder with a devcontainer.json
file and a Dockerfile is built. You are connected to the container environment in Visual Studio Code.
-
Ensure the Linux
.vsix
installer file of the extension is accessible to the container.
.vsix
file into a location within the container, such as a shared folder or the container’s /tmp
directory. If you are using Docker Desktop with file-sharing mode, ensure that the folder is shared with Docker.-
Open the Extensions view (Ctrl+Shift+X), click the ellipsis icon, and select Install from VSIX.
-
Navigate to the
.vsix
file and install it.
LD_LIBRARY_PATH
environment variable. For more information, see Prerequisites for Connectors.-
Build, run, and test your applications.
-
Optional: You can also use the Maven plug-in within the Dev Container to build, run, and test your flows. For more information, see the Maven Documentation.
-
To stop the container, close the Visual Studio Code window or use the Command Palette and select Remote-Containers: Close Remote Connection.
Approach 2: Configuring the .json File with a Custom Image
To manually configure the devcontainer.json
file to use a custom Docker image, perform the following steps:
-
Open Visual Studio Code and open the folder for your Flogo project.
-
Open the Command Palette (Ctrl+Shift+P) and select Dev Containers:Open Folder in Container.
.devcontainer
folder with a devcontainer.json
file does not exist, you are prompted to create one.-
Choose a basic container definition, such as Debian or Ubuntu.
-
In the
devcontainer.json
file, modify the image property to specify your custom image:
"image": "golang:1.24-alpine"
Based on the configuration and your selections, a .devcontainer
folder with a devcontainer.json
file and Dockerfile is built. You are connected to the container environment in Visual Studio Code.
-
Ensure the Linux
.vsix
installer file of the extension is accessible to the container.
.vsix
file into a location within the container, such as a shared folder or the container’s /tmp
directory. If you are using Docker Desktop with file-sharing mode, ensure that the folder is shared with Docker.-
Open the Extensions view (Ctrl+Shift+X), click the ellipsis icon, and select Install from VSIX.
-
Navigate to the
.vsix
file and install it.
-
Build, run, and test your applications.
-
Optional: You can also use the Maven plug-in within the Dev Container for building, running, and testing your flows. For more information, see the Maven Documentation.
-
To stop the container, close the VS Code window or use the Command Palette and select Remote-Containers: Close Remote Connection.
Alpine Linux-based images might have compatibility issues with
glibc
libraries or applications. Enterprise Message Service, which is built onglibc
, encounters relocation errors.Debian or Ubuntu-based images might require installation of the
pkg-config
,libssl-dev
, andzlib1g-dev
packages. You might also need to install the Go language.
Approach 3: Creating and Using a Custom Dev Container Image
To create a custom Docker image from a configured Dev Container for consistent setups that support sharing and reproducibility, perform the following steps:
-
Perform the steps in Approach 1 or Approach 2 to configure a Dev Container.
-
Open a terminal where Docker Desktop is installed.
-
To list the running containers, run the following command:
docker ps
-
Identify the container ID or the name of the running Dev Container.
- To create an image from the running container, run the following command:
- Replace
<container_id_or_name>
with the actual container ID or name - Replace
my-flogo-dev:latest
with a suitable name and tag for your custom image
docker commit <container_id_or_name> my-flogo-dev:latest
-
Optional: If you want to share the image with other developers, push it to a Docker registry by performing the following steps:
-
Log in to a Docker registry:
docker login
-
Push the image:
docker push my-flogo-dev:latest
. Adjust the image name or the tag
-
-
In your project, open the
.devcontainer
or thedevcontainer.json
file. -
To specify the custom image, run the following command:
{
"image": "my-flogo-dev:latest",
// ... other devcontainer.json settings
}
-
Use the Command Palette and select Dev Containers:Open Folder in Container to open the folder in the container.
-
Build, develop, and test your applications.