How to run a docker container from java code? I'm trying to make a SaaS using docker, once the user logs in, I should start a memcached container from java code, this solution doesn't work:
Process p = Runtime.getRuntime().exec("docker images");
Docker cmds run usually on git bash, not on cmd.
PS: I'm using docker on windows.
If you prefer to not install Java on your machine, you can skip this step, and continue straight to the next section, in which we explain how to build and run the application in Docker, which does not require you to have Java installed on your machine. Let's start our application and make sure it is running properly.
You can do it using https://github.com/docker-java/docker-java . It allows you to build a custom image and run it from java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With