I have learned how to use Docker containers, and I'd like to set up a container which contains a binary so that:
- If I ssh to the Docker container, I am prompted as though I had just executed the binary locally
- If I hit a condition that causes the binary to exit, it will restart and prompt me from the beginning again
I get how to expose ports in my containers and I get the gist of Docker networking, but I don't get how to proxy my binary over TCP as described above, the way I often see CTF challenges set up. Any specifics are much appreciated.
Edit: I'll also add that I know how to copy the binary into the container during the image creation. I'm just trying to figure out the service part.