add TODO's for using the docker SDK

pull/338/head
Jesse Duffield 2 years ago
parent 62be3d9924
commit b4509fb45e

@ -197,6 +197,7 @@ func (c *Container) Attach() (*exec.Cmd, error) {
}
c.Log.Warn(fmt.Sprintf("attaching to container %s", c.Name))
// TODO: use SDK
cmd := c.OSCommand.PrepareSubProcess("docker", "attach", "--sig-proxy=false", c.ID)
return cmd, nil
}

@ -336,7 +336,8 @@ func GetDefaultConfig() UserConfig {
DockerComposeConfig: "{{ .DockerCompose }} config",
CheckDockerComposeConfig: "{{ .DockerCompose }} config --quiet",
ServiceTop: "{{ .DockerCompose }} top {{ .Service.Name }}",
ViewContainerLogs: "docker logs --timestamps --follow --since=60m {{ .Container.ID }}",
// TODO: use SDK
ViewContainerLogs: "docker logs --timestamps --follow --since=60m {{ .Container.ID }}",
},
CustomCommands: CustomCommands{
Containers: []CustomCommand{},

@ -569,6 +569,8 @@ func (gui *Gui) handleContainersExecShell(g *gocui.Gui, v *gocui.View) error {
commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{
Container: container,
})
// TODO: use SDK
resolvedCommand := utils.ApplyTemplate("docker exec -it {{ .Container.ID }} /bin/sh -c 'eval $(grep ^$(id -un): /etc/passwd | cut -d : -f 7-)'", commandObject)
// attach and return the subprocess error
cmd := gui.OSCommand.ExecutableFromString(resolvedCommand)

Loading…
Cancel
Save