-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.dorothea
52 lines (40 loc) · 1.28 KB
/
Dockerfile.dorothea
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
# Stage 1: (build)
FROM ubuntu:noble as build
# Install required dependencies for building pmacct
RUN apt-get update && \
apt-get install -y \
libpcap-dev \
pkg-config \
libtool \
autoconf \
automake \
make \
bash \
libstdc++-14-dev \
g++
# Copy pmacct source code into the build
COPY pmacct tmp/pmacct
# Set the working directory to the pmacct directory
WORKDIR /tmp/pmacct
# Run autogen.sh, configure, make, and make install to build pmacct
RUN ./autogen.sh && \
./configure && \
make && \
make install
# Stage 2: Final Image
FROM ubuntu:noble
# Default value for pmacct settings
ENV PMACCT_CONFIG=/dorothea/dorothea-pmacctd.conf
# Copy the built files from the build stage to the final stage
COPY --from=build /usr/local/ /usr/local
# Copy pmacct default config
# The configuration file is present after mounting the volume on the compose examples
#COPY ./dorothea-pmacctd.conf /dorothea/dorothea-pmacctd.conf
# Install libpcap0.8 package required by pmacct
RUN apt-get update && \
apt-get install -y \
libpcap0.8 && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# Set the default command to run pmacctd with the specified configuration file
ENTRYPOINT pmacctd -f ${PMACCT_CONFIG}