https://github.com/cowwoc/anchor4j
A modern Java client for Docker: fluent API, test-friendly, cross-platform
https://github.com/cowwoc/anchor4j
devops docker docker-java integration-testing java testcontainers
Last synced: about 2 months ago
JSON representation
A modern Java client for Docker: fluent API, test-friendly, cross-platform
- Host: GitHub
- URL: https://github.com/cowwoc/anchor4j
- Owner: cowwoc
- License: other
- Created: 2024-12-30T14:56:56.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-07-15T23:08:35.000Z (4 months ago)
- Last Synced: 2025-08-28T18:04:05.795Z (2 months ago)
- Topics: devops, docker, docker-java, integration-testing, java, testcontainers
- Language: Java
- Homepage:
- Size: 7.31 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Support: docs/support-policy-1.0.md
Awesome Lists containing this project
README
[](https://search.maven.org/search?q=g:io.github.cowwoc.anchor4j)
[](https://github.com/cowwoc/anchor4j/actions/?query=workflow%3Abuild)
#
Anchor4J
[](https://cowwoc.github.io/anchor4j/0.10/)
[](docs/changelog.md)
A modern Java client for [Docker](https://www.docker.com/): fluent API, test-friendly, and Kubernetes-ready.
✅ A fluent, strongly typed API.
✅ Support for building images with and without root access.
✅ Easy integration with CI and tests.
✅ First-class support for capturing stdout/stderr and process exit status.
To get started, add this Maven dependency:
```xml
io.github.cowwoc.anchor4j
anchor4j
0.10
```
## Example
```java
import client.io.github.cowwoc.anchor4j.docker.Docker;
import java.io.IOException;
class Example
{
public static void main(String[] args)
throws IOException, InterruptedException
{
DockerClient docker = DockerClient.build();
String imageId = docker.buildImage().
export(Exporter.dockerImage().build()).
build(".");
docker.tagImage(id, "rocket-ship");
docker.pushImage("rocket-ship").push();
}
}
```
## Getting Started
See the [API documentation](https://cowwoc.github.io/docker/0.10/) for more details.
## 💖 Support Ongoing Development 💖
If you find this project helpful, please consider [sponsoring me](https://github.com/sponsors/cowwoc).
Maintaining quality open-source software takes significant time and effort—especially while balancing family
life with young children. Your support helps make this work sustainable.
## Missing Features?
The `anchor4j` API covers a wide range of functionality, and since my time is limited, new features are added
based on user requests. If there's a property or capability you'd like to see added,
please [open a new issue](issues/new).
## Licensing
This library is dual-licensed:
- ✅ [ModernJDK License](docs/modern-jdk-license-1.0.md) (free for personal use or small businesses):
- You may use, modify, and redistribute this software for free when:
- It is compiled for and executed on the latest generally available (GA) Java Development Kit (JDK)
version at the time of deployment.
- You are an individual or a company with 10 or fewer employees.
- You do not rebrand or white-label the software.
- You are not required to update existing deployments when a newer JDK is released.
- 💼 [Commercial License](docs/commercial-license-1.0.md):
- Required for:
- Compiling, running, or distributing the software for older (non-GA) JDK versions.
- Use by companies with more than 10 employees.
- White-labeling or rebranding the library in any form.
## Dependencies
* See [Third party licenses](LICENSE-3RD-PARTY.md) for the licenses of the dependencies.