
Dear Dan, On Tue, 2018-09-04 at 12:21 +0100, Daniel Rolls via Haskell-Cafe wrote:
Secondly, my two "stack build" calls where the first builds a hello world program feels a bit hacky. is there a better way to achieve this?
I cannot comment on the Stack parts of your questions, since I don't currently use it. Regarding the Docker parts, however, have you tried something like COPY [ \ "cabal.config", \ "*.cabal", \ "./"] RUN cabal update \ && \ cabal install -j --only-dependencies prior to your main compilation layer? That would install the dependencies once, with the layer cache expiring on change to the lib declarations, without the need for the 'hello world' program you describe. In case you don't freeze your dependencies, you can likely remove the `cabal.config` line. Peace, tiredpixel