Search code examples
javadockerprocessbuilder

How to run docker commands in windows using a Java program?


Ref: https://rominirani.com/docker-on-windows-mounting-host-directories-d96f3f056a2c

I want to manipulate my data by using docker image of gdal. The problem is I have to create a GUI wrapper in Java using Swing. How can run the docker command from Java ProcessBuilder? That is run the powershell commands from Java.


Solution

  • There are a plenty of Java wrappers around Docker API, like docker-java or docker-java-api. Pick one and you're good to go.