Static executables in minimal Docker containers

I'm trying to put together a minimal Docker container consisting of nothing
but GHC-compiled static executables. Below you can see a full interaction
I've had with GHC and Docker. The high level summary is that:
* When compiled statically, the executable runs just fine in both my host
OS (Ubuntu 14.04) and an Ubuntu 14.04 Docker image
* That same executable run from a busybox (or a "scratch" image, not shown
here since it's slightly longer to set up) hangs and then runs out of memory
I've watched the process in top, and it uses up a huge amount of CPU and
memory. I get the same behavior whether I compiled with or without
optimizations or the multithreaded runtime. I also get identical behavior
with both GHC 7.8.4 and 7.10.1.
I'm not sure how best to proceed with trying to debug this, any suggestions?
vagrant@vagrant-ubuntu-trusty-64:~/Desktop$ cat > hello.hs <

On 13 April 2015 at 10:54, Michael Snoyman
I'm trying to put together a minimal Docker container consisting of nothing but GHC-compiled static executables. Below you can see a full interaction I've had with GHC and Docker. The high level summary is that:
* When compiled statically, the executable runs just fine in both my host OS (Ubuntu 14.04) and an Ubuntu 14.04 Docker image * That same executable run from a busybox (or a "scratch" image, not shown here since it's slightly longer to set up) hangs and then runs out of memory
From what I remember busybox allows for quite a bit of configurability, so "a busybox" might need a bit more details mabye.
Have you attempted running it under `strace` and/or `ltrace`? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus

On Mon, Apr 13, 2015 at 12:07 PM Magnus Therning
On 13 April 2015 at 10:54, Michael Snoyman
wrote: I'm trying to put together a minimal Docker container consisting of nothing but GHC-compiled static executables. Below you can see a full interaction I've had with GHC and Docker. The high level summary is that:
* When compiled statically, the executable runs just fine in both my host OS (Ubuntu 14.04) and an Ubuntu 14.04 Docker image * That same executable run from a busybox (or a "scratch" image, not shown here since it's slightly longer to set up) hangs and then runs out of memory
From what I remember busybox allows for quite a bit of configurability, so "a busybox" might need a bit more details mabye.
Have you attempted running it under `strace` and/or `ltrace`?
Sorry, I left off a word: I meant "a busybox image." There's a standard busybox Docker image which I'm testing with via the command I pasted below. There are certainly ways to configure busybox itself, but it should be trivial for others to reproduce this error simply by running my series of commands. Unfortunately, strace and ltrace aren't available in that Docker image, but it's a good idea to see if I can get them running there somehow. Michael
participants (2)
-
Magnus Therning
-
Michael Snoyman