I just found out I could use multi-stage builds to solve my problem: https://docs.docker.com/develop/develop-images/multistage-build/ The idea is to use the command "FROM" again after building...
On Mon, Feb 11, 2019 at 5:20 PM Corentin Dupont <corentin.dup...@gmail.com> wrote: > Hi Michael, > thanks for the reply. > I'm trying to create Dockerfiles for reproducible builds. I have a > platform with components written in various languages, so I don't expect > users to install all build tools to compile... So I strive to provide > Dockerfiles that manage both compilation and deployment. > Maybe it's a misunderstanding on my side to try to get both compilation > and deployement in the same Dockerfile? > Thanks a lot. > > > On Mon, Feb 11, 2019 at 4:22 PM Michael Snoyman <mich...@snoyman.com> > wrote: > >> I use Docker extensively in Haskell projects, both for builds and >> deployments. We do this for most work at FP Complete as well, and most of >> our clients do too. The issue you're running into is that you're using a >> Haskell _build_ image (which includes GHC and other build tools) for >> creating a runtime image. My recommendation: based your deployment on a >> much more lightweight image. You can start off with Ubuntu, for example, or >> fpco/pid1:18.04 (which includes a more intelligent pid-1 process). Some >> people will argue that you should try to use something more minimal, and/or >> try to do static linking. I think starting off with Ubuntu is perfectly >> reasonable. >> >> Some relevant blog posts: >> >> * >> https://www.fpcomplete.com/blog/2017/12/building-haskell-apps-with-docker >> * https://www.fpcomplete.com/blog/2016/10/static-compilation-with-stack >> * >> https://www.fpcomplete.com/blog/2018/07/deploying-rust-with-docker-and-kubernetes >> (Rust instead of Haskell, the ideas translate) >> >> On Mon, Feb 11, 2019 at 4:04 PM Corentin Dupont < >> corentin.dup...@gmail.com> wrote: >> >>> Hi, >>> I'm trying to create a docker container for my application (to deploy it >>> on Amazon ECS). >>> I'm using https://github.com/freebroccolo/docker-haskell >>> However, the images generated are huge: from 4 Go to 7Go. >>> https://github.com/freebroccolo/docker-haskell/issues/86 >>> >>> Any feedback on experience with Haskell in Docker? My feeling is that >>> Haskellers doesn't use it too much... Am I wrong? >>> >>> Corentin >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "haskell-stack" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to haskell-stack+unsubscr...@googlegroups.com. >>> To post to this group, send email to haskell-stack@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/haskell-stack/CAEyhvmpdVTqiCHTzf8MkAzit2WOPdz36sZmtU-FLQ6HSm1jT%2Bw%40mail.gmail.com >>> <https://groups.google.com/d/msgid/haskell-stack/CAEyhvmpdVTqiCHTzf8MkAzit2WOPdz36sZmtU-FLQ6HSm1jT%2Bw%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- You received this message because you are subscribed to the Google Groups "haskell-stack" group. To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stack+unsubscr...@googlegroups.com. To post to this group, send email to haskell-stack@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/CAEyhvmrpiaZp3uFeQ-672Av7dyKFHV9kXJas4DcmdzeMqdzDHQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.