Humpback Agent 主要为 Humpback 平台提供容器访问功能。API 文档
- First, you need an server that installed and already running docker(recommend Linux).
[Optional]If you are develop on windows, you should expose docker host with tcp protocol(default isunix:///var/run/docker.sock). How to do it?
# convert unix-connect as container port 6666, mapping the container port 6666 as host port 1234
docker run -d --restart=always \
-p 0.0.0.0:1234:6666 \
-v /var/run/docker.sock:/var/run/docker.sock \
alpine/socat \
tcp-listen:6666,fork,reuseaddr unix-connect:/var/run/docker.sockexpose your docker host at tcp:<ip>:1234 more info.
- Use
go getinstall the dependencies.
Notice: GOPATH is very important!
[Optional], If you are develop on windows, change theconf/app.conf DOCKER_ENDPOINTconfig.
# For example
DOCKER_ENDPOINT = tcp://192.168.1.200:1234
# DOCKER_ENDPOINT = unix:///var/run/docker.sock
DOCKER_API_VERSION = v1.21- cd
humpback-agentfolder, rungo run main.go curl http://localhost:8500/v1/dockerinfocheck the service status.
Apache-2.0