imy
imy

Reputation: 466

IntelliJ IDEA + (Docker) Compose V2 + Podman (Desktop) on Windows (WSL2)

The question

How to correctly couple (Docker-)Compose with Podman and enable it through the IntelliJ IDEA UI?

Context

The general question-idea is how to build a development setup on Windows for a Java web application (Spring Boot, actually JHipster) which relies on services running in containers?

Previously I used docker installed directly in WSL2 (Ubuntu), but it was always kind of a random thing, because of the networking problems, mainly - container to host connectivity. So I'm looking for a solid setup which can be easily grasped by other team members.

Our development setup is described primarily with the docker-compose.yml (V2) in connection with the Java Spring Boot project in an IntelliJ IDEA.

So, we need:

  1. Run the required services from the docker-compose.yml (i.e. DBs, related apps), including few built with our custom Dockerfile.
  2. Run the Java application within the IntelliJ IDEA in the debug mode - on Windows, no containerization here.
  3. Except the Java app should be able to talk with the services in the containers, some of these should be able to reach the application back (mapping ports from containers to the Windows host).

Currently I'm exploring a way with a Podman Desktop, also as a step towards kubernetization. So, I've done:

  1. Installed Podman Desktop v0.14.1 from the official page.
  2. Installed Podman v4.4.4 with the install button in the Podman Desktop UI.
  3. Updated Podman to v4.5.0 using the official guide.
  4. "Installed" compose with the Podman Desktop UI tray button, but it did not give me any "compose" cli available or I don't know where to find it, so I
  5. Downloaded a docker-compose.exe binary and pointed IntelliJ IDEA to it.

The dashboard looks like this:

enter image description here

IntelliJ IDEA Docker setup looks like this:

enter image description here

and

enter image description here

At this point, all "compose-only" services are starting ok from the IntelliJ UI, and the current blocker is an error about the docker.io/moby/buildkit when I try to run services build with custom Dockerfile from the IntelliJ IDEA UI:

[+] Building 0.2s (0/1)
[+] Building 0.5s (1/1) FINISHED
 => ERROR [internal] booting buildkit                    0.5s 
 => => starting container buildx_buildkit_default        0.4s 
------
 > [internal] booting buildkit:
[+] Building 0.0s (1/1) FINISHED
 => CANCELED [internal] booting buildkit                 0.0s 
Error response from daemon: crun: create `/sys/fs/cgroup/docker/buildx`: Permission denied: OCI permission denied
`docker-compose` process finished with exit code 17

enter image description here

Upvotes: 7

Views: 3990

Answers (1)

Movion
Movion

Reputation: 1

I looked to a solution for this and found that post and also this video (https://www.youtube.com/watch?v=e7uMH8aVuc4) that explains how to use podman with IntelliJ so I want to add the solution here too for seekers in the future.

To use docker-compose and podman with IntelliJ you need to adjust the settings for the Docker Plugin so it looks at the right executables.

Settings Screenshot

Open the IntelliJ Settings:

Build, Execution, Deployment -> Docker -> Tools

Change the path for "Docker executable: " to

C:\Program Files\RedHat\Podman\podman.exe

and the path for the compose to:

C:\Users\USER\AppData\Local\Microsoft\WindowsApps\docker-compose.exe

Upvotes: 0

Related Questions