This took me full days to find, so I am posting this for future reference.
I am developing C++ on a docker image. I am using clion.
My code is compiled in debug mode, and runs fine in run mode, but when trying to debug, the process exits immediately with the very informative
Process finished with exit code 1
When switching the debugger from
to
Trying to debug still exits, but yields a popup in clion
'A packet returned error 8'
The same code debugs fine on a local computer.
The docker run
command is
RUN_CMD="docker run --group-add ${DOCKER_GROUP_ID} \
--env HOME=${HOME} \
--env="DISPLAY" \
--entrypoint /bin/bash \
--interactive \
--net "host" \
--rm \
--tty \
--user=${USER_ID}:${GROUP_ID} \
--volume ${HOME}:${HOME} \
--volume /mnt:/mnt \
$(cat ${HOME}/personal-uv-docker-flags) \
-v "${HOME}/.Xauthority:${HOME}/.Xauthority:rw" \
--volume /var/run/docker.sock:/var/run/docker.sock \
--workdir ${HOME} \
${IMAGE} $(${DIR}/impl/known-tools.py cmd-line ${TOOL})"
How to debug C++ on docker?