Commit 74d8203d authored by duanjinfei's avatar duanjinfei

update container port type

parent dea86434
...@@ -12,7 +12,7 @@ type TaskCmd struct { ...@@ -12,7 +12,7 @@ type TaskCmd struct {
} }
type DockerCmd struct { type DockerCmd struct {
ContainerPort string `json:"container_port"` ContainerPort int64 `json:"container_port"`
HostIp string HostIp string
HostPort string HostPort string
} }
......
...@@ -16,6 +16,7 @@ import ( ...@@ -16,6 +16,7 @@ import (
"io" "io"
"net/http" "net/http"
"os" "os"
"strconv"
"time" "time"
) )
...@@ -174,7 +175,7 @@ func (d *DockerOp) CreateContainer(imageName string, dockerCmd *models.DockerCmd ...@@ -174,7 +175,7 @@ func (d *DockerOp) CreateContainer(imageName string, dockerCmd *models.DockerCmd
}, },
} }
exposePortSet := make(nat.PortSet) exposePortSet := make(nat.PortSet)
natPort, _ := nat.NewPort("tcp", dockerCmd.ContainerPort) natPort, _ := nat.NewPort("tcp", strconv.FormatInt(dockerCmd.ContainerPort, 10))
exposePortSet[natPort] = struct{}{} exposePortSet[natPort] = struct{}{}
portMap := make(nat.PortMap) portMap := make(nat.PortMap)
portMap[natPort] = portBinds portMap[natPort] = portBinds
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment