Issue with Creating Remote Containers Using Dev Containers 242 in IDEA 24.2

Answered

In IDEA 24.1 (dev containers 241), you could connect from a local environment (Windows) to a remote server (Linux) Docker instance and successfully build a remote container by selecting the local devcontainer.json file.

However, in IDEA 24.2 (dev containers 242), after connecting from a local environment (Windows) to a remote server (Linux) Docker instance, you can only select the remote devcontainer.json file and encounter the following error:

Worker binary deploy failed: Worker binary deploy failed: check command log for details: com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "docker.exe": CreateProcess error=2, The system cannot find the file specified.

`Ideally, IDEA should be able to build directly using the remote Docker server without requiring Docker to be installed locally. Is this a bug or is it by design? Why does this issue not occur in version 24.1?`

Here is my devcontainer.json configuration file:

```
{
    "name": "Remote Dev",
    "workspaceMount": "source=/remote-dev/test,target=/workspaces,type=bind",
    "workspaceFolder": "/workspaces",
    "image": "demo/remote-dev:latest",
    "runArgs": [
        "--cap-add=SYS_PTRACE",
        "--security-opt",
        "seccomp=unconfined"
    ],
    "remoteUser": "root"
}
```

0
5 comments

Hello, 9mlcy7.

In IDEA 24.1 (dev containers 241), you could connect from a local environment (Windows) to a remote server (Linux) Docker instance and successfully build a remote container by selecting the local devcontainer.json file.

However, in IDEA 24.2 (dev containers 242), after connecting from a local environment (Windows) to a remote server (Linux) Docker instance, you can only select the remote devcontainer.json file

 

You still should be able to build the dev container on the remote Docker Engine from the local devcontainer.json in 2024.2 - just use the gutter icon in the file opened in Editor and Create Dev Container and Clone Sources… option.

 

Ideally, IDEA should be able to build directly using the remote Docker server without requiring Docker to be installed locally.

 

This workflow was implemented in the earlier IDE versions, but since 2023.3 it is necessary to have at least local Docker CLI to properly build images and/or running Docker Compose configurations on the remote host. Please check this article in our Knowledge base for more details and instructions.

 

 

1

First, thank you for your response. Regarding "using the local devcontainer.json," you're correct; it is indeed possible to use IDEA to open and build the container. Secondly, about your point that starting from version 2023.3, a local Docker CLI is required, I have a question. In the 2024.1 version of IDEA (Dev Container 241 version), I can directly use a remote Docker to build without relying on a local Docker CLI. Why is that?

0

Could you please specify exactly how you started the dev container build? Is it from the File | Remote Development… window with the remote Docker Engine specified and the From Local Project option selected?

 

 

If so, could you please also specify if you synchronized the files from your local project with the remote server? This option shouldn't work if you don't have the directory with the same path as your local project on your remote server.

0

我的目录是正确的,在你回复的图片中,我使用了24.1和24.2两个版本后发现,选择远程的docker,在选择json 文件时,24.1只能选择本地的文件,24.2只能选择目标docker服务器的文件,而且24.1可以不依赖本地的docker,而24.2就必须在本地运行docker

0

9mlcy7, the option on the screenshot I shared above shouldn't have worked in 2024.1. It is possible for this option to work on your side only if the project sources exist on the remote server where Docker is installed in the same absolute path as on your local PC - in another case, you should've received the bind error:

 

 

So, the previous IDE behavior in 2024.1 you described was not expected and was a bug rather than a valid working feature. 

0

Please sign in to leave a comment.