我正在嘗試在我的 docker 容器中安裝 delve 以調(diào)試 Go 應(yīng)用程序。在我的 Dockerfile 中,我輸入:RUN go get github.com/go-delve/delve/cmd/dlv但是當(dāng)我進(jìn)入 docker 容器并運行時dlv它說bash: dlv: command not foundgo get github.com/go-delve/delve/cmd/dlv我嘗試通過直接在容器中運行來手動安裝它。它結(jié)束時沒有輸出。但我仍然遇到相同的“找不到命令”錯誤看起來它根本沒有安裝 delve。這是我的環(huán)境變量和容器內(nèi)的 Go bin 目錄:root@5d8aef1f6721:/my/project# printenv | grep GOGOFLAGS=-mod=vendorGOLANG_VERSION=1.19.1GOROOT=/usr/local/goGOPATH=/goroot@5d8aef1f6721:/my/project# printenv | grep PATHPATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binGOPATH=/goroot@5d8aef1f6721:/my/project# ls -la /go/bintotal 23540drwxrwxrwx 1 root root 4096 Sep 20 10:29 .drwxrwxrwx 1 root root 4096 Sep 20 10:28 ..-rwxr-xr-x 1 root root 24085739 Sep 20 10:29 samlroot@5d8aef1f6721:/my/project# ls -la /usr/local/go/bintotal 17456drwxr-xr-x 2 root root 4096 Aug 31 17:40 .drwxr-xr-x 10 root root 4096 Aug 31 17:40 ..-rwxr-xr-x 1 root root 14520630 Aug 31 17:40 go-rwxr-xr-x 1 root root 3340906 Aug 31 17:40 gofmt我很困惑為什么它沒有安裝...知道嗎?
Delve 不安裝在 docker 容器中
HUH函數(shù)
2023-02-14 18:12:57