JDK-8179498 (the parent of this CR) describes a feature request to make the Attach API work better between a linux host and the docker containers it launches. Logically these containers are running on different machines/devices, and the Attach API does between 2 differences devices. However, since the the linux host has access to the processes in the docker containers, the Attach API can be made to work between them with some modifications and described in JDK-8179498.
Since JDK-8179498 is being pushed to 10, this enhancement should be documented. However, what should also be documented is a gap in the full docker support as also noted in JDK-8179498. More specifically, the host has no ability to find and list all the JVMs running in the docker containers. This means, for instance, they won't show up in the "jcmd -l" output, and also won't be discovered when using "jcmd <MyClassName>". Instead you need to provide the PID of the JVM process you want to attach to. Other tools that use the Attach API will show similar JVM discovery issues, but I don't know these tools well enough to say exactly how they would manifest.