Quarkus Docker Client

The Quarkus Docker Client extension provides seamless integration with Docker through a native Java API. It supports multiple named clients, automatic platform-specific socket detection, and built-in health checks.

Key features:

  • Multiple named Docker client instances for different environments

  • Automatic platform-specific Docker daemon socket detection

  • Health check integration for Docker daemon connectivity

  • Registry authentication support

  • TLS/SSL configuration for secure daemon communication

Installation

If you want to use this extension, you need to add the io.quarkiverse.docker:quarkus-docker-client extension first to your build file.

For instance, with Maven, add the following dependency to your POM file:

<dependency>
    <groupId>io.quarkiverse.docker</groupId>
    <artifactId>quarkus-docker-client</artifactId>
    <version>0.0.3</version>
</dependency>

Usage

Default Client

Inject the default Docker client:

@Inject
DockerClient dockerClient;

// Use the client
dockerClient.pingCmd().exec();

Named Clients

Configure and use multiple Docker clients:

# Default client configuration
quarkus.docker.docker-host=tcp://localhost:2375

# Production client configuration
quarkus.docker."production".docker-host=tcp://prod-host:2375
quarkus.docker."production".enabled=true
@Inject
@NamedDockerClient("production")
DockerClient productionClient;

Health Checks

Enable health checks to monitor Docker daemon connectivity:

quarkus.docker.health-check=true

Extension Configuration Reference