Skip to Main Content

Use a docker from a remote server in idea to use a debug remote container

Benefits: Use a remote docker container to reduce pressure on the local environment and reduce some of the worst tools (e.g. LibreOffice) that you need to rely on to install Java programs in your local environment

Use Instructions

  • Preparing remote docker server
# Edit file `~/.ssh/config`

Host fa.intranet.company
  HostName 10.0.11.111
  User root
  IdentitFile ~/.ssh/id_ed25519

docker1 docker2 docker3

  • Write Dockerfile

参考文件地址

  • idea configuration

Autogenerate base configuration by runrun

Then click the edit configuration to automatically build the jar package and start the docker container

edit1 edit2

This is the time to process the configuration to run it. Click on it to debug the Java program in Docker.

  • Add debug configuration

debug1 debug2 debug3

This will make it possible to use the Java program in the remote docker container in idea.