2020-12-10

单独编译 (dokcer manger)
  1. 调用命令
    CGO_ENABLED=1 GOOS=linux go build -ldflags "-s -w" -ldflags=-compressdwarf=false -o manager -a manager.go
  2. 打开文件
vim /etc/compose/topav.yaml
  1. 添加睡眠 ( command: sleep 100000000 )
 center-web:
    image: docker-hub.cloud.top/srp-av/center-web:2.0.0
    links:
      - mongo:mongo.topsec
      - influx:influx.topsec
      - broker:broker.topsec
      - node-manager:node-manager
      - elasticsearch:elasticsearch.topsec
      - center-probe-1:center-probe-1.topsec
      # - dgraph_dgserver:dgraph_dgserver.topsec
    #command: sleep 100000000

  1. 删除并重启
docker-compose -f /etc/compose/topav.yaml  -p topav stop center-web
docker-compose -f /etc/compose/topav.yaml  -p topav rm -f center-web
docker-compose -f /etc/compose/topav.yaml  -p topav up -d center-web
  1. 先编译程序
// 使用此命令将编译好的程序发送到容器中去
docker cp manager topav_center-web_1:/root
  1. 进入容器
docker exec -it topav_center-web_1 bash
cd root 
chmod 777 manger
./manager -c /var/config-map/manager.conf 

你可能感兴趣的:(2020-12-10)