In this tutorial, I will explain how to install gdb (gnu debugger) in Docker container. If you are using ubuntu, you can install it using below command (don’t try, this is for sample only):
darklinux@darklinuxpc:~$ sudo docker run -it --name ubuntu-gdb ubuntu:bionic /bin/bash root@55e461812aff:/# apt-get update Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB] Get:3 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [8815 B] Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:5 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [59.3 kB] Get:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Get:7 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [930 kB] Get:8 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB] Get:9 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [852 kB] Get:10 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB] Get:11 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB] Get:12 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB] Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1385 kB] Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [1226 kB] Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [73.6 kB] Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [20.1 kB] Get:17 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [8158 B] Get:18 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [8286 B] Fetched 17.9 MB in 19s (933 kB/s) Reading package lists... Done (more…)