When I'm trying to get the Docker integration of IntelliJ (Ultimate 2018.3.3) working together with local running Docker Desktop (Version 2.0.0.3 (31259)), I'm getting the following error:
Cannot connect: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: localhost:127.0.0.1:2375
caused by: java.net.ConnectException: Connection refused: no further information
I found the following question: IntelliJ cannot connect to protected tcp Docker socket
But this solution leads to this error:
Cannot connect: com.github.dockerjava.api.exception.DockerClientException: Enabled TLS verification (DOCKER_TLS_VERIFY=1) but certificate path (DOCKER_CERT_PATH) is not defined.
I searched for the cert path of Docker Desktop but found nothing yet because the new Hyper-V solution of Docker Desktop doesn't run docker-machine native any more.
Make sure the Docker plugin is installed and enabled To enable Docker support in IntelliJ IDEA Community Edition or IntelliJ IDEA Edu, install the Docker plugin from the Marketplace. Press Ctrl+Alt+S to open the IDE settings and select Plugins. Find the Docker plugin and make sure it is installed and enabled.
To switch to Windows containers in Docker, right-click the Docker icon, and select Switch to Windows containers. To use the command line to switch between containers, run & $Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchDaemon .
In the Project tool window, right-click the project name, point to New and click File. In the New File dialog, type Dockerfile and press Enter . This Dockerfile builds an image based on the openjdk:17 image from Docker Hub.
The solution is to enable exposing the Docker deamon on tcp:localhost:2375 without TLS. This option can be found in general settings of Docker Desktop (Version 2.0.0.3).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With