ubuntu搭建vscode的go环境 && 编译调试runc 全过程
删除旧版本go
yum remove go
apt-get remove go
rm -r /usr/local/go
更新go
官网(ubuntu)
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go
配置go环境
go env -w GOPATH=$HOME/go
export GOPATH=$HOME/go
github 配置国内加速
git config --global url."https://hub.fastgit.org".insteadOf https://github.com
配置go代理
参考网站
export GOPROXY=https://goproxy.io,direct
export GOPRIVATE=git.mycompany.com,github.com/my/private
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct
export GO111MODULE=on
export GOPROXY=https://goproxy.io
下载安装vscode
安装插件:除了go需要,其他大家随意 go chinese rainbow …… 使用install all 安装其他插件 
runc
参考网站
sudo apt-get install libseccomp-dev
mkdir -p $GOPATH/go/src/github.com/opencontainers
cd $GOPATH/go/src/github.com/opencontainers
git clone https://github.com/opencontainers/runc
cd runc
sudo apt-get install build-essential
sudo add-apt-repository ppa:criu/ppa
sudo apt-get update
sudo apt install criu
make
sudo make install
vscode 调试 runc
添加调试参数  这里添加参数   成功!
如果编译出来发现和运行的二进制程序不一样
修改makefile中的二进制输出位置参考 
|