mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 00:21:04 +00:00
add TODO's for using the docker SDK
This commit is contained in:
parent
62be3d9924
commit
b4509fb45e
3 changed files with 5 additions and 1 deletions
|
|
@ -197,6 +197,7 @@ func (c *Container) Attach() (*exec.Cmd, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Log.Warn(fmt.Sprintf("attaching to container %s", c.Name))
|
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)
|
cmd := c.OSCommand.PrepareSubProcess("docker", "attach", "--sig-proxy=false", c.ID)
|
||||||
return cmd, nil
|
return cmd, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -336,7 +336,8 @@ func GetDefaultConfig() UserConfig {
|
||||||
DockerComposeConfig: "{{ .DockerCompose }} config",
|
DockerComposeConfig: "{{ .DockerCompose }} config",
|
||||||
CheckDockerComposeConfig: "{{ .DockerCompose }} config --quiet",
|
CheckDockerComposeConfig: "{{ .DockerCompose }} config --quiet",
|
||||||
ServiceTop: "{{ .DockerCompose }} top {{ .Service.Name }}",
|
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{
|
CustomCommands: CustomCommands{
|
||||||
Containers: []CustomCommand{},
|
Containers: []CustomCommand{},
|
||||||
|
|
|
||||||
|
|
@ -569,6 +569,8 @@ func (gui *Gui) handleContainersExecShell(g *gocui.Gui, v *gocui.View) error {
|
||||||
commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{
|
commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{
|
||||||
Container: container,
|
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)
|
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
|
// attach and return the subprocess error
|
||||||
cmd := gui.OSCommand.ExecutableFromString(resolvedCommand)
|
cmd := gui.OSCommand.ExecutableFromString(resolvedCommand)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue