3 ms·
I'm considering Docker for a small side project I have where I want to deploy a Runnable Java Jar as a daemon. Getting Java paths right across different Linux d
by diltonm 12y ago
I'm considering Docker for a small side project I have where I want to deploy a Runnable Java Jar as a daemon. Getting Java paths right across different Linux distributions can be a hassle, hoping Docker will help me solve this. For that matter, getting a daemon (service) running correctly on different Linux'es is one more thorn I'd rather not have to deal with.
- deleted 12y ago[deleted]
- chroem- 12y agoSo you're going to add a whole virtualization layer instead of just using "java -jar myapp.jar &"? Sorry, but what? And what do you mean about getting class paths right? Somehow I don't think best practice Java development necessarily calls for virtualization.
- djur 12y agoDocker is not a virtualization layer.
- chroem- 12y ago>Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating system–level virtualization on Linux.
- zaptheimpaler 12y agoDocker is based on LinuX Containers (LXC), which are much more lightweight than a full OS VM. Containers are basically namespaces for processes, networks so I would expect way lower overhead than a full fledged VM. More details here - http://stackoverflow.com/a/16048358/803923 http://stackoverflow.com/a/16048358/803923 http://blog.dotcloud.com/under-the-hood-linux-kernels-on-dotcloud-part http://blog.dotcloud.com/under-the-hood-linux-kernels-on-dot... It is a virtualization layer, but not nearly as heavyweight (and perhaps not as well isolated) as a full VM. As to the isolation - I don't know how "good" it is, but I expect it will only get better. I think this is what PG means by "do things that don't scale".
- chroem- 12y agoBut for the case of deploying Java applications, it seems particularly redundant. The JVM already has a very extensive security manager framework, and since it's Java it's already write once run everywhere. You can even easily bundle your entire project into a single executable .jar for deployment. As a Java developer, I can't fathom why someone would want to add a redundant layer of cruft on top of their project. Docker may be the latest trendy thing, but it seems like many of its users aren't entirely sure why they need it. Edit: I should clarify that I have nothing against hypervisors or other virtualization and sandboxing schemes. However, a lot of people seem to be running Docker, under an outside hypervisor, in order to run their also virtualized language runtime. That strikes me as a bit pointless.
- diltonm 12y agoIt's the daemonizing part that complicates things. Running java -jar MyApp.jar is easy, running it under the control of a system init script, dealing with how to ensure it's restartable as other daemons, logging, log rotation, where Java is really located on the system are all variables that affect any daemonized application; not just Java apps but ones written in any language, Ruby, Python, C or C++. Docker seems like a good way to "contain" the problem domain challenges I outlined, hoping anyway.
- djur 12y agoYou learn something new every day. I've only ever heard the term used to refer to machine-level virtualization. Thanks for the information.