Using existing Docker connections from the Docker plugin

Currently, we execute plain docker run system commands from our plugin’s run configuration when the user wants to run some command in a Docker container, which is not ideal because we basically would have to re-implement all the features of the Docker plugin regarding the Docker connection (socket path, podman, etc).
Is there some way we could reuse the Docker connections from the Docker plugin?