4 ms·
Running Java on Docker images on a Mac
- yjgyhj 9y agoI have been working on a Clojure (so JVM) program that I run in Docker for Mac. It requires some data on disk, which is about 100GB. Since my laptop has a pathetic 250GB SSD I got an external drive for this. All well. But I get the problem that the Mac shuts down after doing IO from inside the VM for about 10-20 minutes. Just a black screen and a second later reboot. Has anyone on this forum had the same issue? I have the same when running in VirtualBox, and after wiping the Mac totally and reinstalling the OS. Happens using both USB and Thunderbolt.
- sillysaurus3 9y agoOut of curiosity, what are some reasons to run the Clojure program inside of docker? Could you bypass the issue by just running it locally?
- yjgyhj 9y agoI do so because my Clojure app I'm writing also depends on other programs from 3rd party vendors (open source stuff). I'm too old to spend time setting shit up on every develop machine, server etc. If I can just write one declarative file (docker-compose.yml) and then be done that's nice, so that is what I do. Deploying on Linux anyways, so Docker isn't a performance overhead.
- bschwindHN 9y ago> It requires some data on disk, which is about 100GB As someone who develops on a Macbook with a 128 GB drive, this is completely crazy to me. How is it taking up 100 GB? I use Docker for Mac for most of my day-to-day development, mostly for running docker-compose environments so I have separated Redis/Postgres environments for each app. They take up nowhere near 100 GB. Something sounds very wrong, but I can't imagine how it would be caused by the JVM running Clojure.
- kbar13 9y agoit sounds like OP's program reads some dataset, and it is 100GB in size.
- tokenizerrr 9y agoSometimes applications have to read and process data from the filesystem. I have several ~100gb datasets 9f large amounts of sensor data.
- chrisseaton 9y ago> Something sounds very wrong How can it be wrong to simply have 100 GB of data that you need to operate on? If that's how much data you have then that's how much you have.
- yjgyhj 9y ago> How is it taking up 100 GB? A couple of blockchains. As said, it's the data of my app, not Clojure or Docker.
- bschwindHN 9y agoOh, I read it as "Yeah it takes up some space on my drive, like 100 GB". Having it as actual data the program is processing makes way more sense, sorry about that.
- bpicolo 9y agoDocker for mac has absolutely dreadful filesystem performance for mounted volumes (Docker toolbox with the extra virtualbox indirection actually ends up being faster if you're doing filesystem reads even remotely frequently). If you need to work with 100GB on disk you're going to have a lot of problems. https://github.com/docker/for-mac/issues/77 https://github.com/docker/for-mac/issues/77
- yjgyhj 9y agoFor this reason I went out to buy a Intel NUC and am now running NixOS on there. Developing on that machine, with a Clojure nRepl connected via SSH. Works great, especially since my service can now be running and fetching data from the internet when my laptop is closed, so that next time I work I don't have to wait for my service to catch up with the world.
- gameface 9y agoWhat are the reasons for wanting to run java inside docker? The jvm is supported andavailable, and portable on every environment socket is, so what does it get you?
- twelve40 9y agoif, say, zookeeper was a dependency for local development and you didn't want to go through the installation on every laptop... i guess?
- jvwilge 9y agoThat's right and another possibility is to create a small cluster to do integration testing (on Jenkins for example). It's more easy to share containers with colleagues so you don't have to worry about about dependencies. It's also easier to limit cpu/memory in a container to check the cpu/memory requirements of your application.
- codeN 9y agoI have faced issues relating to requiring specific versions of JDK for each software. I don't work with Java so using a docker would have been a simpler solution, sadly this was before dockers became mainstream.
- dagw 9y agoRunning multiple specific version of the JDK is kind of a pain. So if you are working on projects targeting specific versions of the JDK then isolating each on in its own container isn't the dumbest thing to do.
- currywurst 9y agoBut initializing the JAVA_HOME and related env variables before launching your java process should help, right?
- madeofpalk 9y ago
- floatboth 9y agoSo much for "write once, run everywhere". "Write once, run on Linux" doesn't sound as good :(
- eicnix 9y agoI believe its more like "write once, run everywhere except for mac". Microsoft is working on running linux containers natively on Windows.
- hedwall 9y agoBoth the xhyve and hyper-v drivers for docker does the same thing, boots a tiny Linux VM that can run docker for you.
- geofft 9y agoI'm very excited about how the Linux syscall ABI has become the new standard - Windows, Linux, FreeBSD, and Solaris (well, SmartOS, and Solaris 10) all support it now. If only macOS would catch up!
- yegortimoshenko 9y agoVM, inside a virtualization layer, inside an operating system, inside a VM, inside an operating system.
- JulianWasTaken 9y agohttps://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death...