3 ms·
I use socat daily. Nearly all of the microservices we develop have a way to be run locally with all dependent services using docker-compose. The problem is mo
by prhn 6y ago
I use socat daily.
Nearly all of the microservices we develop have a way to be run locally with all dependent services using docker-compose.
The problem is most teams don't provide a way to do efficient local development for their particular service. Some do remote debugging into the built/running container (slow and requires rebuilding docker image for every change). Some inspect logs to debug (yikes!).
When I want to debug a particular service in IntelliJ, I simply remove it from the docker network and replace it with a container running socat, forwarding the appropriate port to host.docker.internal (the host machine). This is on a MAC, of course, where Docker runs in a VM.
This allows me to do in-IDE debugging of any service that runs in the docker network without having to rebuild the image every time I make a change.
I know there are IntelliJ plugins that provide a similar workflow, but I believe they all build an image and deploy a container to the network for every change. I could be wrong.
- tomerbd 6y agoInteresting .. Can you provide an example?
- robbles 6y agoHow do you swap out the container in docker-compose? Do you just have a service defined for each, and only start one of them?
- e12e 6y ago> remove it from the docker network and replace it with a container running socat, forwarding the appropriate port to host.docker.internal (the host machine Would you happen to have a fully worked example of this? We to have some services that we can and do run via docker compose - but it's often a cumbersome process to move one and one service out of the docker compose setup for debug/devel.