On 13 April 2015 at 10:54, Michael Snoyman <mic...@snoyman.com> 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`?
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.
--Failing that, you might be able to get useful information of the same kind by running docker (the server, not the `docker run` command) under perf[0] and then running your busybox container. It should at least give you an idea of what it's doing when it explodes.Sharif
You received this message because you are subscribed to the Google Groups "Commercial Haskell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commercialhask...@googlegroups.com.
To post to this group, send email to commerci...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/commercialhaskell/86ca2603-37f2-4645-9cd2-f09703f2be67%40googlegroups.com.
#!/bin/bash
set -e
set -x
cat > tiny.hs <<EOF
main :: IO ()
main = putStrLn "Hello from a tiny Docker image"
EOF
ghc tiny.hs
strip tiny
cat > Dockerfile <<EOF
FROM snoyberg/haskell-scratch
ADD tiny /tiny
CMD ["/tiny"]
EOF
docker build -t tiny .
docker run --rm tiny
The /lib/ version of the file was necessary for statically linked executables I believe. It's arguably better to just remove it and tell people "don't do static executables" I suppose, given that they're clearly not *actually* static in reality ;)
To unsubscribe from this group and stop receiving emails from it, send an email to commercialhask...@googlegroups.com.
To post to this group, send email to commerci...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/commercialhaskell/553407EF.1030303%40gmail.com.