Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andriisoldatenko/debugging-containerized-go-applications
Different debug examples for dockerized Go application
https://github.com/andriisoldatenko/debugging-containerized-go-applications
debug debugging delve docker gdb go golang remote-debug
Last synced: 2 months ago
JSON representation
Different debug examples for dockerized Go application
- Host: GitHub
- URL: https://github.com/andriisoldatenko/debugging-containerized-go-applications
- Owner: andriisoldatenko
- Created: 2019-07-30T10:42:02.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-09-26T13:06:10.000Z (about 1 year ago)
- Last Synced: 2024-06-21T18:10:44.397Z (6 months ago)
- Topics: debug, debugging, delve, docker, gdb, go, golang, remote-debug
- Language: Shell
- Size: 21.5 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## debug dockerized Go application using Delve
## Sample-app
Just hello world```make
make build-sample-app
make run-sample-app
```#### Debug inside docker via delve:
>Note: If you are trying to debug `linux/amd64` containers on m1 echo $DOCKER_DEFAULT_PLATFORM
linux/amd64 you need to revisit https://github.com/docker/for-mac/issues/5191#issuecomment-821319621
>```
export DOCKER_DEFAULT_PLATFORM=""
docker build -t dlv-debug -f Dockerfile-dlv-debug .
docker run -it dlv-debug
/usr/src/app # dlv debug
Type 'help' for list of commands.
(dlv) b main.main
Breakpoint 1 set at 0xb9d80 for main.main() ./hello.go:9
(dlv) c
> main.main() ./hello.go:9 (hits goroutine(1):1 total:1) (PC: 0xb9d80)
4: "fmt"
5:
6: "rsc.io/quote"
7: )
8:
=> 9: func main() {
10: nums := []int{2, 3, 4}
11: t := dummy
12: _ = t
13: for i, num := range nums {
14: if num == 3 {
(dlv)
```### Links