So, you want to use the docker
command-line client in a Java application. We’ve got you covered. Created by Mihai A., this lightweight Java Docker client solves some of the problems that other Java Docker clients have. It came up on our radar and let’s just say, we were really impressed by it!
What benefits does Java API for Docker have over other clients?
From Mihai’s blog post: “I want to access Docker from Java, not to build/assemble Docker in Java – I hope you feel the difference.” While the difference between the two ideas may sound small, it is actually a big chasm.
Java wrapper for Docker
Let’s highlight some facts:
SEE ALSO: How well do you know your Docker trivia?
- The Java API for Docker is as lightweight as possible. Because of this, it plays well with other frameworks. Mihai says that it also works well with Java EE.
- It is a true API, not an SDK. The other two available Java implementations differ in that they are purely SDKs. (Wait, hit the brakes for a moment. What’s the difference? An API is an Application Programming Interface and an SDK is a Software Development Kit. Think of opening a box of LEGO. The SDK is the kit with a group of bricks needed to make the house or Death Star or car, or in this case, the SDK has all the tools you need for building software. SDKs always contain APIs. However, an API is just an interface. They can be used by anything, so long as you know how. APIs are not always SDKs.)
- The client focuses on a high level of fluency and JDK integration.
For more information from the creator about the goals of this library, check out the blog post.
Mihai goes into great depth about his vision that birthed Java API for Docker and why he chose an API over an SDK and it’s a great read for anyone interested in the mindset behind this Java wrapper. It raises some great points about the learning curve behind other Docker libraries and usability issues. (Not to mention it brought up some serious Tom & Jerry nostalgia. You’ll see.)
For those interested in testing out this solution, the library is a Maven dependency. Also, be sure to see the wiki. (Maybe you will even want to contribute? According to the blog, it is still in its early stages. Personally, we would love to see more like this.)
Save the whales?
SEE ALSO: Assertions in the Java programming language
Before we wrap up, let’s talk about Docker for a moment. Many assert that Kubernetes has the won the so-called war. We do agree that it is quickly becoming the standard and has risen in popularity dramatically.
However, Docker is still going strong and the rise of Kubernetes isn’t displacing it from certain use cases.
According to the Forrester New Wave ™: Enterprise Container Platform Software Suites, Q4 2018 report, it led the way in enterprise container platform software suites. The report stated that it is “well-suited for the enterprise”.
The two are different technologies with different uses and aren’t always in direct competition with one another.
The post Object-oriented Java client for Docker: wrap it up in Java appeared first on JAXenter.
Source : JAXenter