-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.armhf
80 lines (62 loc) · 2.93 KB
/
Dockerfile.armhf
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Builds a docker image for a darkstat
FROM arm32v7/debian:stable-slim as builder
COPY qemu-arm-static /usr/bin/
###############################################
## ENVIRONMENTAL CONFIG ##
###############################################
# Set correct environment variables
ENV DEBIAN_FRONTEND noninteractive
ENV HOME="/root" LC_ALL="C.UTF-8" LANG="en_US.UTF-8" LANGUAGE="en_US.UTF-8"
WORKDIR /
###############################################
## INSTALL ENVIRONMENT ##
###############################################
# Add these repositories for following deb installation.
RUN echo '# Debian Stretch, mises à jour "volatiles" + paquets non libres' > /etc/apt/sources.list \
&& echo 'deb http://deb.debian.org/debian/ stable-updates main contrib non-free' >> /etc/apt/sources.list \
&& echo '# Debian Stable, mises à jour "volatiles" + paquets non libres' >> /etc/apt/sources.list \
&& echo 'deb http://deb.debian.org/debian stable main contrib non-free' >> /etc/apt/sources.list \
&& apt-get update && apt-get install -y zlib1g-dev \
libpcap-dev git autoconf \
build-essential vim-common
#########################################
## COMPILATION ##
#########################################
RUN git clone https://www.unix4lyfe.org/git/darkstat \
&& cd /darkstat \
&& mkdir build \
&& autoconf \
&& autoheader \
&& ./configure --prefix=$PWD/build/ \
&& make \
&& make install
###############################################
###############################################
## PRODUCTION ##
###############################################
FROM arm32v7/debian:stable-slim as production
MAINTAINER Didier C <[email protected]>
COPY qemu-arm-static /usr/bin/
###############################################
## ENVIRONMENTAL CONFIG ##
###############################################
# Set correct environment variables
ENV DEBIAN_FRONTEND noninteractive
ENV HOME="/root" LC_ALL="C.UTF-8" LANG="en_US.UTF-8" LANGUAGE="en_US.UTF-8"
WORKDIR /
###############################################
## INSTALL ENVIRONMENT ##
###############################################
# Add these repositories for following deb installation.
RUN echo '# Debian Stretch, mises à jour "volatiles" + paquets non libres' > /etc/apt/sources.list \
&& echo 'deb http://deb.debian.org/debian/ stable-updates main contrib non-free' >> /etc/apt/sources.list \
&& echo '# Debian Stable, mises à jour "volatiles" + paquets non libres' >> /etc/apt/sources.list \
&& echo 'deb http://deb.debian.org/debian stable main contrib non-free' >> /etc/apt/sources.list \
&& apt-get update && apt-get install -y libpcap0.8 \
&& rm -rf /var/lib/apt/lists/* /var/cache/* /var/tmp/*
COPY --from=0 /darkstat/build darkstat
COPY run.sh /run.sh
RUN chmod +x /run.sh
VOLUME ["/darkstat/config"]
EXPOSE 667
CMD ["/run.sh"]