Search code examples
dockerintellij-ideaintellij-plugin

IntelliJ IDEA and docker plugin


I am using IntelliJ IDEA 2017.1.4 with Docker plugin. When I click debug, it will build the project, docker, it will start it up and I can see log from the container. Unfortunatelly, debugger is not attached to that container. Error message:

Cannot retrieve debug connection: java.net.MalformedURLException: unknown protocol: tcp

When I create new remote debug configuration for the defined port 5001, I can attach to running container. Why it's not attached directly from plugin please?

My configuration: container_settings.json

{
  "HostConfig": {
    "PortBindings": {
      "5001/tcp": [
        {
          "HostIp": "0.0.0.0",
          "HostPort": "5001"
        }
      ]
    }
  }
}

enter image description hereenter image description here

Thank you.


Solution

  • Issue solved.

    In IntelliJ IDEA settings - Ctrl + Alt + S open Build, Execution, Deployment and Docker.

    Previously my API url was tcp://localhost:2375, and it build and deployed container without any problem, but did not attach debugger to it. After changing to https://localhost:2376 everything works perfect.