In the How to use this image section here, the following Dockerfile is given as an example:
FROM haskell:8
WORKDIR /opt/example
RUN cabal update
COPY ./example.cabal /opt/example/example.cabal
RUN cabal install --only-dependencies -j4
COPY . /opt/example
RUN cabal install
CMD ["example"]
However, when I try to build this image and it reaches the command RUN cabal install --only-dependencies -j4 cabal fails with an error saying "Could not find module: x with any suffix", where x is the first module listed in my cabal file under library -> exposed-modules.
So it looks like Cabal needs the source code files of my project to be present when running --only-dependencies and I don't understand why.
For reference, I'm using the haskell:8.8.4-buster image.
In the How to use this image section here, the following Dockerfile is given as an example:
However, when I try to build this image and it reaches the command
RUN cabal install --only-dependencies -j4
cabal fails with an error saying "Could not find module: x with any suffix", where x is the first module listed in my cabal file underlibrary -> exposed-modules
.So it looks like Cabal needs the source code files of my project to be present when running
--only-dependencies
and I don't understand why.For reference, I'm using the
haskell:8.8.4-buster
image.