
You can ask stack to build only dependencies and use that as a cache layer
for docker. We do something like:
FROM haskell:7.10
WORKDIR /app
COPY LICENSE Setup.hs simple-app.cabal stack.yaml /app/
RUN stack setup
RUN stack build simple-app --only-dependencies
COPY main /app/main
COPY src /app/src
RUN stack build simple-app --copy-bins
On Wed, Feb 24, 2016 at 1:07 PM, Lyndon Maydwell
Hi Beginners,
I'm finally getting my hands dirty with Stack, and am using it in conjunction with Docker, but not with the built-in docker functionality.
My Dockerfile is constructed so that it first installs a whole bunch of dependencies globally, like so:
... RUN stack install HUnit ...
Then after that, installs the project:
... COPY . /app WORKDIR /app RUN stack install ...
This means that on repeated docker builds the app build and install time should be limited to just the application itself, because the dependency builds were cached. Which is great! However, I'm currently generating the list of dependencies just by looking at the output of the stack build of the app, and this displays everything as a flat list.
I'd like to see some kind of tree instead, so that when I pre-install the dependencies, I can specify a minimal list, rather than a whole slew of dependencies that would be pulled in transitively anyway.
Is there an easy way to do this?
Regards,
- Lyndon
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners