My personal docker image for osrm-backend development. It's based on the telenavmap/osrm-backend-dev which includes all dependencies.
$ cd docker/osrm-backend-dev
$ docker build -t wangyoucao577/osrm-backend-dev .
DockerHub Repo: wangyoucao577/osrm-backend-dev
$ docker pull wangyoucao577/osrm-backend-dev
Github Package Repo: docker.pkg.github.com/wangyoucao577/containers/osrm-backend-dev
$ docker pull docker.pkg.github.com/wangyoucao577/containers/osrm-backend-dev
$ docker run -d -p 19001:22 -p 5000:5000 --shm-size 64g --cap-add=SYS_PTRACE --security-opt seccomp=unconfined wangyoucao577/osrm-backend-dev
4dce06ca751f4ee803df809396b8e1ed830f496ed530f52476034a92d35c8fe2
After run above command, we get a deamon container which can be connect by ssh
via port 19001
. --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
is used to let gdb
works, more discussion see Docker - Issues Encountered, and How to use GDB within Docker Container explains it very well.
Refer to VS Code Remote Development for more usage.
- Install latest VSCode on your local
Debugging via Remote-Containers
- Install Remote-Containers extension in your local vscode
- TODO:
Debugging via Remote-SSH
- Install Remote-SSH extension in your local vscode
- Make sure
ssh
works on your local machine:ssh -i <YOUR_PRIVATE_KEY> -p 19001 root@<CONTAINER_IP>
- Use "Remote-SSH: Connect to Host" to connect to your container in vscode
- Install vscode extensions remotely
- The C/C++ extension is mandatory.
- All other extensions are optional but good to have, e.g. Git History, GitLens, etc.
- Either install from the vscode Extensions page,
- Or install by "Extensions: Install from VSIX", choose
/workspace/vscode/cpptools-linux.vsix
- "Open Folder", choose
/workspace/osrm-backend
- "Tasks: Run Task", run
cmake debug generate
- "Tasks: Run Task", run
build debug
F5
to launch program, add breakpoints to debug