Skip to content
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
16 changes: 16 additions & 0 deletions task.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,19 @@ func (t *Task) Bind(src, dst string) (string, error) {
}
return fmt.Sprintf("%s:%s", expanded, dst), nil
}

// BindDockerSocket is a utility function which binds the docker socket
func (t *Task) BindDockerSocket() error {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to call this AddBindDockerSocket, to align with Bind and AddBind.

// For now, assumes /var/run/docker.sock from host
// Untested with remote docker
dockerSocket, err := t.Bind("/var/run/docker.sock", "/var/run/docker.sock")
if err != nil {
return err
}

t.AddBinds([]string{dockerSocket})

return nil
}

// TODO: add tests