Last active
March 11, 2021 19:06
-
-
Save cijohnson/8db8742ec941fdbef651b588c243e438 to your computer and use it in GitHub Desktop.
Debugging go binary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Below steps are followed to install go/dlv and debug the running golang process in container. | |
export GOVERSION=1.14 | |
yum install -y git wget | |
cd /; wget https://golang.org/dl/go$GOVERSION.linux-amd64.tar.gz | |
cd /; tar -C /usr/local -xzf go$GOVERSION.linux-amd64.tar.gz | |
cd /; export PATH=$PATH:/usr/local/go/bin | |
cd /; go get -u github.com/go-delve/delve/cmd/dlv | |
cd /; export PATH=$PATH:$PWD/go/bin:/root/go/bin | |
export GOPATH=/go | |
dlv attach <pid of the commandappserver process> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment