Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request Merge Feature/1.4.0 #5

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ _testmain.go
*.exe
*.test
*.prof
vendor/
vendor/
.idea/
36 changes: 19 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
version 1.2.4
---
- Add DOCKER_AGENT_IPADDR env, Register to cluster ipaddr, default 0.0.0.0 auto bind local ipaddr.
# Changelog

version 1.1.2 (not released)
---
- Change github.com/docker/engine-api(Deprecated) to github.com/docker/docker/client
### version 1.3.4

version 1.1.1
---
- Remove network mode's validate when create container.
- Supported edit single mode and cluster mode containers.

version 1.3.0
---
- Add container `--log-opt` property.
### version 1.3.3

version 1.3.3
---
- Supported docker compose containers.

version 1.3.4
---
- Supported edit single mode and cluster mode containers.
### version 1.3.0

- Add container `--log-opt` property.

### version 1.2.4

- Add DOCKER_AGENT_IPADDR env, Register to cluster ipaddr, default 0.0.0.0 auto bind local ipaddr.

### version 1.1.2 (not released)

- Change github.com/docker/engine-api(Deprecated) to github.com/docker/docker/client

### version 1.1.1

- Remove network mode's validate when create container.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM frolvlad/alpine-glibc:alpine-3.7

MAINTAINER bobliu [email protected]
LABEL author="bobliu" email="[email protected]"

RUN apk add --no-cache bash

Expand Down
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,48 @@

Humpback Agent 主要为 [Humpback](https://github.com/humpback/humpback) 平台提供容器访问功能。[API 文档](https://github.com/humpback/humpback-agent/wiki)

## How to develop

### #Prepare

1. First, you need an server that installed and already running docker(recommend Linux).
2. `[Optional]` If you are develop on windows, you should expose docker host with tcp protocol(default is `unix:///var/run/docker.sock`). How to do it?

```bash
# 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.sock
```

expose your docker host at `tcp:<ip>:1234` [more info](https://hub.docker.com/r/alpine/socat/).

### #Init dependencies

1. Use `go get` install the dependencies.

**Notice: GOPATH is very important!**

### #Build & Run

1. `[Optional]`, If you are develop on windows, change the `conf/app.conf DOCKER_ENDPOINT` config.

```bash
# For example
DOCKER_ENDPOINT = tcp://192.168.1.200:1234
# DOCKER_ENDPOINT = unix:///var/run/docker.sock
DOCKER_API_VERSION = v1.21
```

2. cd `humpback-agent` folder, run `go run main.go`
3. `curl http://localhost:8500/v1/dockerinfo` check the service status.

## License

Apache-2.0

## Changelog

[CHANGELOG.md](CHANGELOG.md)
5 changes: 5 additions & 0 deletions conf/app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ autorender = false
copyrequestbody = true
servertimeout = 600

# enalbe validate auth token
ENABLE_AUTHORIZATION = true
AUTHORIZATION_TOKEN = 123456

# DOCKER_ENDPOINT = tcp://192.168.1.200:1234
DOCKER_ENDPOINT = unix:///var/run/docker.sock
DOCKER_API_VERSION = v1.21
DOCKER_REGISTRY_ADDRESS = http://192.168.2.80
Expand Down
Loading