这是indexloc提供的服务,不要输入任何密码
Skip to content

Support other means of providing access to the Docker Daemon #69

@m90

Description

@m90

Right now, a Docker client will only be created when the socket is mounted into the container using a hard check for /var/run/docker.sock:

_, err := os.Stat("/var/run/docker.sock")
if !os.IsNotExist(err) {
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
if err != nil {
return nil, fmt.Errorf("newScript: failed to create docker client")
}
s.cli = cli
}

User might want to use other means of providing this (e.g. a proxied HTTP service by setting DOCKER_HOST).

Instead of hard coding the socket location, we could:

  • research which means of providing access would be supported by calling client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
  • add all of them to the conditional

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions