docker network create debug-net
Mount your compiled binary (Linux) into the container and expose port 2159 to both the host and the docker network (only one is required).
docker run --network debug-net --network-alias gdbserver --publish 2159:2159 --privileged --rm --volume ~/Documents/Development/code/:/code/ zfields/gdbserver :2159 /code/<binary>
NOTE: By exposing the port to the host (
--publish 2159:2159), you can connect to the GDB server directly from the host. Alternatively, by connecting to a Docker network (--network debug-net --network-alias gdbserver), you can use a GDB instance running in a container to connect to the GDB server.
Content type
Image
Digest
Size
7.1 MB
Last updated
over 8 years ago
docker pull zfields/gdbserver