Skip to content

Commit

Permalink
Fixing workflow (Docker Image CI) 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermodotn committed May 25, 2024
1 parent 6797809 commit e6aea43
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Dockerfile.dorothea
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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
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
CMD pmacctd -f ${PMACCT_CONFIG}

0 comments on commit e6aea43

Please sign in to comment.