docker-dmd
docker-dmd copied to clipboard
Create alpine images
Hey,
Love your images! Is it possible to use alpine or publish alpine images too?
Best, SerialVelocity
(this probably also would be good for ldc, etc)
Musl (the alternative glibc replaced used by Alpine) hasn't been supported by DRuntime. However, recent work is closing this gap and compiling DRuntime with Musl will be possible soon (see https://github.com/dlang/druntime/pull/2071).
This may also be possible by using https://hub.docker.com/r/frolvlad/alpine-glibc/ or https://github.com/sgerrand/alpine-pkg-glibc
- It doesn't work (at least when I tried it half a year ago)
- Using the bulky glibc kills the entire point of using alpine in the first place ;-)
- Ah, that's a shame. There are hacky things in that image to make it work from what I remember.
- It doesn't really make a bulky image. It's 5MB instead of 43MB 😄 (for some reason I thought Ubuntu was in the 100s of MB though)
This should be possible now, with the ldc 1.8 release. There's an Alpine/x64 build up there, and I've updated the changelog with exactly which Alpine packages I needed to use it. Post in the microservices thread in the General forum to publicize any images you make available.
I built out an LDC on alpine using that build andrewbenton/alpine-ldc, but it still has the aforementioned issues with musl and druntime until that's patched up. An interesting approach that's worked tam4s/hello-vibe involves building a static binary with ubuntu and then loading it onto alpine.