-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathDockerfile
33 lines (24 loc) · 1021 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM haskell:8.8.4
ENV RESOLVER lts-16.31
COPY --from=dastapov/hledger:1.20.4 /usr/bin/hledger* /usr/bin/
COPY ./01-getting-started/export/export.hs /tmp
# Precompile all packages needed for export.hs
RUN stack --resolver $RESOLVER --system-ghc script --package shake --package directory /tmp/export.hs -- -v \
&& rm -r /tmp/export.* \
&& rm -rf /root/.stack/pantry \
&& chmod -R g+wrX,o+wrX /root \
&& apt-get update \
&& apt-get install --yes patchutils gawk csvtool ripgrep parallel \
&& rm -rf /var/lib/apt/lists \
&& cd /usr/bin/ \
&& curl -L https://github.com/lotabout/skim/releases/download/v0.8.1/skim-v0.8.1-x86_64-unknown-linux-gnu.tar.gz | tar xz
RUN adduser --system --ingroup root hledger
# This is where the data dir would be mounted to
RUN mkdir full-fledged-hledger
VOLUME /full-fledged-hledger
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"]