Skip to content
New issue

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

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

Already on GitHub? # to your account

支持启动容器时运行的命令行参数 #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions object/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ type RunDescriptionEntity struct {
NetworkList []string `yaml:"network_list"`
PublishList []string `yaml:"publish_list"`
VolumeList []string `yaml:"volume_list"`
Cmd []string `yaml:"cmd"`
Entrypoint []string `yaml:"entrypoint"`
}

type KetherObjectEntity struct {
Expand Down Expand Up @@ -103,6 +105,8 @@ func (ketherObjectEntity *KetherObjectEntity) GetKetherObject() *KetherObject {
NetworkList: ketherObjectEntity.Requirement.NetworkList,
PublishList: ketherObjectEntity.Requirement.PublishList,
VolumeList: ketherObjectEntity.Requirement.VolumeList,
Cmd: ketherObjectEntity.Requirement.Cmd,
Entrypoint: ketherObjectEntity.Requirement.Entrypoint,
},
}
}
Expand Down Expand Up @@ -222,6 +226,8 @@ func (ketherObject *KetherObject) GetContainerAndHostConfig() (*container.Config
containerConfig := &container.Config{
Image: ketherObject.GetImageName(),
ExposedPorts: exposedPorts,
Cmd: ketherObject.Requirement.Cmd,
Entrypoint: ketherObject.Requirement.Entrypoint,
}
hostConfig := &container.HostConfig{
PortBindings: portBindings,
Expand Down