Can Intellij be used with a Visual-Studio-Code style docker devcontainer?

Viewed 8125

I've been using devcontainers in Node development in VSC and enjoy the idea that I can commit a shared configuration to ensure everyone on the team has the same runtime/buildtime. I've been looking for a similar way to configure IntelliJ, but am having some difficulties determining if this is even possible.

I am running IntelliJ 2020.2 and have the Node Remote Interpreter plugin installed.

In my devcontainer, I map a Docker volume node_modules to my workspace such that all my different containers can share the same volume, and not need to re-download the set of npm modules everytime.

I have setup & created an appropriate Run/Debug Docker configuration, and when I launch it, the container is built & configured properly. However, in IntelliJ, understandably, the node_modules folder still remains blank (as that folder is only mounted in the remote container).

Similarly, I have setup a remote Node run configuration pointing to my docker image, but similarly, IntelliJ does not see any libraries that are supposed to be in the node_modules folder.

Is there any way to work with this kind of configuration in IntelliJ such that the IDE understands the mappings I create in my Docker container?

2 Answers

no, there is no such feature in IDEA. Please vote for IDEA-202267 to be notified on any progress with this feature request

JetBrains now supports GitPod as a first class citizen implementation for the Development Containers concept. Both IntelliJ Idea and the next-gen IDE Fleet are supported. Also JetBrains Space would be an option, if you have licences for it in your company. There's a landing page that present all the options:

enter image description here

In contrast to the VSCode style implementation of the concept where you configure your Dev Containers using a devcontainer.json with GitPod you use a .gitpod.yml. But GitPod is already working actively on supporting the devcontainer.json format, which was Open Sourced by Microsoft here.

More details and in-depth review of the Development Containers concept can be found in this post.

Related