1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| $ docker run -it -d --name go --network host golang /bin/bash
$ docker exec -it go /bin/bash
$ echo "deb http://repo.huaweicloud.com/debian bullseye main deb http://repo.huaweicloud.com/debian-security bullseye-security main deb http://repo.huaweicloud.com/debian bullseye-updates main" > /etc/apt/sources.list $ apt update
$ apt install -y unzip
$ go env -w GO111MODULE=on $ go env -w GOPROXY=https://goproxy.cn,direct
$ go get github.com/golang/protobuf/proto $ go get github.com/golang/protobuf/protoc-gen-go $ go get github.com/micro/micro/v3/cmd/protoc-gen-micro $ go get github.com/micro/micro/v3
$ curl -OL https://ghproxy.com/https://github.com/protocolbuffers/protobuf/releases/download/v3.19.1/protoc-3.19.1-linux-x86_64.zip $ unzip -o protoc-3.19.1-linux-x86_64.zip -d /usr/local bin/protoc $ unzip -o protoc-3.19.1-linux-x86_64.zip -d /usr/local 'include/*' $ rm -f protoc-3.19.1-linux-x86_64.zip
$ exit
$ docker commit go micro:v1
$ docker rm -f go
$ docker run -d --name micro-server --network host micro:v1 micro server
$ docker run -d -it --name micro --network host micro:v1 /bin/bash
$ docker exec -it micro /bin/bash
|