-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing workflow (Docker Image CI) 2.
- Loading branch information
1 parent
6797809
commit e6aea43
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |