Skip to content

Use Unix Socket for Docker Client Communication #16

@saden1

Description

@saden1

Currently we HTTP communication is used. This is not ideal and requires extensive configuration. Try using unix socket for communicating with docker.

// Create a client based on DOCKER_HOST and DOCKER_CERT_PATH env vars
final DockerClient docker = DefaultDockerClient.builder().uri("unix:///var/run/docker.sock")
                .build();

// Pull an image
 docker.pull("busybox", new AnsiProgressHandler());
<dependency>
    <groupId>com.spotify</groupId>
    <artifactId>docker-client</artifactId>
    <version>8.14.5</version>
    <classifier>shaded</classifier>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.25</version>
</dependency>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions