Skip to content

Commit

Permalink
New docker image: haskell 8.8.3, STACK_ROOT and lts-15.4
Browse files Browse the repository at this point in the history
  • Loading branch information
adept committed Jun 4, 2020
1 parent 29d29db commit e42659b
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
FROM haskell:8.6.5
FROM haskell:8.8.3

COPY --from=dastapov/hledger:1.17 /usr/bin/hledger* /usr/bin/
ENV RESOLVER lts-15.4

COPY --from=dastapov/hledger:1.17.1.1 /usr/bin/hledger* /usr/bin/

COPY ./01-getting-started/export/export.hs /tmp

# Precompile all packages needed for export.hs
RUN /tmp/export.hs -v && rm -r /tmp/export.hs /root/.stack/indices/Hackage/00-index.tar /root/.stack/indices/Hackage/00-index.tar.gz && chmod -R g+rX,o+rX /root /root/.stack/
RUN stack --resolver $RESOLVER --system-ghc script --package shake --package directory /tmp/export.hs -- -v \
&& rm -r /tmp/export.hs \
&& chmod -R g+wrX,o+wrX /root \
&& apt-get update \
&& apt-get install --yes patchutils gawk sudo \
&& rm -rf /var/lib/apt/lists

RUN apt-get update && apt-get install --yes patchutils gawk && rm -rf /var/lib/apt/lists
RUN adduser --system --ingroup root hledger

# This is where the data dir would be mounted to
RUN mkdir full-fledged-hledger
WORKDIR full-fledged-hledger
VOLUME full-fledged-hledger

RUN mkdir /home/user && chmod 0777 /home/user
ENV HOME /home/user
RUN echo "cp -a /root/.stack /home/user" > /home/user/.bashrc
ENV STACK_ROOT /root/.stack
RUN echo "allow-different-user: true" >> /root/.stack/config.yaml

USER hledger
WORKDIR full-fledged-hledger
ENV LC_ALL C.UTF-8

CMD ["bash"]

0 comments on commit e42659b

Please sign in to comment.