How can I connect Eclipse IDE to a Docker container running on a server on my network?

101 Views Asked by At

Greetings all

I am wondering how can I connect my Eclipse IDE to a Docker container running on a server on my home-network. The server is running Linux and already has SSH enabled. One of the containers I want to connect to is an Amazon Linux container. The other is a Tomcat container.

I was able to connect my Eclipse IDE to that server itself using Remote Systems Explorer, and can view it's files.

Eclipse connected to server

But I want to go a step further, and connect to a container running on that server. I would like to view and edit the files, and if possible, debug.

The docker container in question is built using:

FROM public.ecr.aws/amazonlinux/amazonlinux:2.0.20230207.0
.
.
.
# ssh port
EXPOSE 22

After changes are made, they are published to a tomcat container, also running on the same server. I would also like to connect my Eclipse to that container and debug(using a remote Debugger).

The tomcat docker container is built using:

FROM eclipse-temurin:8-jdk-jammy
.
.
.
.
# enable remote debugger
ENV JPDA_ADDRESS 8001
ENV JPDA_TRANSPORT dt_socket
EXPOSE 8080
EXPOSE 8001
CMD ["catalina.sh", "jpda", "run"]

Any idea how I may go about achieving that? Any help would be GREATLY appreciated

0

There are 0 best solutions below