1

How can I run a Docker container without installing Docker Hub?

For example:

  1. Is there a library which can execute docker commands from inside another program?
  2. Perhaps a lightweight .exe which I could distribute with the container to run it?

I am distributing my application to the public and I cannot expect them to have Docker Hub installed. They must be able to download the latest version and simply double click on something to start it (such as a .exe or .bat)

My application is a learning game in Java.

Atom
  • 325
  • 1
  • 11
  • 3
    Does this actually need to be a container, or do you just need a JVM? Are there prebuilt solutions to run a Java application without separately installing the JRE that make more sense? – David Maze Jul 06 '21 at 17:21
  • The answer is not necessarily? But because the app is moddable (using Java/JAR files) I'd thought that containerisation would add security, plus it would make it possibly easier to manage the programs resources because I wouldn't need to deal with different OSs. – Atom Jul 06 '21 at 18:05
  • 1
    But Java is already platform independent, so why would you need to deal with different OSs? Docker would only add obfuscation, not security. If someone decided to see what's inside, a docker container wouldn't be much trouble if they intend to also decompile the classes or whatever it is you're afraid of. – Kayaman Jul 06 '21 at 18:26
  • My thought would be about sandboxing modded code which might not be safe - my understanding is that code executing inside the container is not aware of the parent device, so malicious code wouldn't be able to access the device as a whole. Small worry but it was part of my reasoning. – Atom Jul 06 '21 at 18:46
  • So you're afraid of a rogue plugin destroying your user's system. Have you considered `SecurityManager` or did you get the C++ plugins working, which could bypass it? Also some form of signing schemes could work for the plugins on a larger scale. – Kayaman Jul 06 '21 at 19:53

1 Answers1

1

Docker "Hub" is a website. You don't install it.

To run Docker containers, you need to install a Docker daemon, regardless of the application code you'd be running. And no, Docker is not secure, nor does it claim to be.

There are other containerd implementations for running containers (although, not specifically for Windows), however all will require installing something.

If you're distributing a JVM application, then there's plenty of real world examples doing that. Intellij & Eclipse for example are written in Java and don't require Docker, so why would you think you do?

Refer How can I convert my Java program to an .exe file?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • Fair enough, it is the Docker daemon which runs the containers, though I was referring (rightly or wrongly) to the desktop application. I have previously considered using Launch4J to package as an .exe file (though that I think is a question for a different time and would open up a number of new questions). I... don't think that you require Docker to run a Java application... Either way, I think in this question I was looking to find a solution like Podman (again, not something I have looked at greatly), though I think that peoples' suggestions have given enough food for thought. Thanks all! – Atom Aug 16 '21 at 12:22