Compare commits
1 Commits
0.8.78-alp
...
0.8.79
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a84e7da65f |
@@ -227,17 +227,27 @@ func (api *API) ListContainer(ctx context.Context, name string) ([]types.Service
|
||||
|
||||
svs := make(map[string]types.Service)
|
||||
for _, container := range containers {
|
||||
name := "UNKNOWN"
|
||||
if len(container.Names) > 0 {
|
||||
name = container.Names[0]
|
||||
}
|
||||
|
||||
port := -1
|
||||
ip := "UNKNOWN"
|
||||
if len(container.Ports) > 0 {
|
||||
ip = container.Ports[0].IP
|
||||
port = int(container.Ports[0].PublicPort)
|
||||
}
|
||||
|
||||
// container name have extra forward slash
|
||||
// https://github.com/moby/moby/issues/6705
|
||||
if strings.HasPrefix(container.Names[0], fmt.Sprintf("/%s", name)) {
|
||||
svs[container.Image] = types.Service{
|
||||
Name: container.Names[0],
|
||||
Image: container.Image,
|
||||
ID: container.ID,
|
||||
Host: container.Ports[0].IP,
|
||||
Port: int(container.Ports[0].PublicPort),
|
||||
State: container.State,
|
||||
}
|
||||
svs[container.Image] = types.Service{
|
||||
Name: name,
|
||||
Image: container.Image,
|
||||
ID: container.ID,
|
||||
Host: ip,
|
||||
Port: port,
|
||||
State: container.State,
|
||||
}
|
||||
}
|
||||
services := []types.Service{}
|
||||
|
||||
2
fx.go
2
fx.go
@@ -16,7 +16,7 @@ import (
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
const version = "0.8.78"
|
||||
const version = "0.8.79"
|
||||
|
||||
func init() {
|
||||
go checkForUpdate()
|
||||
|
||||
@@ -10,7 +10,7 @@ run() {
|
||||
local port=$2
|
||||
# localhost
|
||||
$fx up --name ${service}_${lang} --port ${port} --healthcheck test/functions/func.${lang}
|
||||
$fx list # | jq ''
|
||||
$fx list
|
||||
$fx down ${service}_${lang} || true
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export_image() {
|
||||
if [[ "$DOCKER_REMOTE_HOST_ADDR" != "" ]];then
|
||||
cloud_name='fx-remote-docker-host'
|
||||
$fx infra create --name ${cloud_name} --type docker --host ${DOCKER_REMOTE_HOST_USER}@${DOCKER_REMOTE_HOST_ADDR}
|
||||
$fx use ${cloud_name}
|
||||
$fx infra use ${cloud_name}
|
||||
fi
|
||||
|
||||
port=20000
|
||||
|
||||
Reference in New Issue
Block a user