forked from AlDanial/cloc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (36 loc) · 938 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Dockerfile by Sébastien HOUZÉ, https://github.com/shouze
FROM perl:slim AS base
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
git \
unzip \
dos2unix \
&& rm -rf /var/lib/apt/lists/*
#Install all dependencies
RUN cpanm \
Algorithm::Diff \
Digest::MD5 \
Parallel::ForkManager \
Regexp::Common \
&& rm -rf $HOME/.cpanm
#Copy source code
COPY cloc /usr/src/
RUN find /usr/src/ -type f -exec dos2unix {} \;
####################
FROM base AS test
#Copy test code
COPY .git /usr/src/.git
COPY tests /usr/src/tests
COPY Unix /usr/src/Unix
WORKDIR /usr/src/Unix
#Checkout of cloc_submodule_test for t/02_git.t tests
RUN git clone https://github.com/AlDanial/cloc_submodule_test.git
#Run tests
RUN make test
####################
FROM base AS final
WORKDIR /tmp
ENTRYPOINT ["/usr/src/cloc"]
CMD ["--help"]