2024-08-08 14:11:30 -03:00
|
|
|
FROM rust:latest
|
|
|
|
|
2024-08-22 13:17:24 -03:00
|
|
|
# Install necessary packages
|
2024-08-08 14:11:30 -03:00
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
libudev-dev \
|
|
|
|
iproute2 \
|
|
|
|
iputils-ping \
|
2024-08-16 13:14:54 -03:00
|
|
|
net-tools \
|
|
|
|
bridge-utils \
|
|
|
|
iptables \
|
2024-08-16 18:07:17 -03:00
|
|
|
traceroute \
|
2024-08-22 13:17:24 -03:00
|
|
|
nmap \
|
|
|
|
tcpdump \
|
2024-08-29 12:25:32 -03:00
|
|
|
util-linux \
|
|
|
|
bsdmainutils \
|
2024-08-22 13:17:24 -03:00
|
|
|
vim \
|
2024-08-08 14:11:30 -03:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Clone the xbnet repository
|
|
|
|
RUN git clone https://github.com/jgoerzen/xbnet.git /usr/src/xbnet
|
|
|
|
|
|
|
|
# Build xbnet
|
|
|
|
WORKDIR /usr/src/xbnet
|
2024-08-16 13:14:54 -03:00
|
|
|
RUN cargo build --release
|
2024-08-08 14:11:30 -03:00
|
|
|
|
2024-08-16 13:37:05 -03:00
|
|
|
# Copy the built binary to /usr/local/bin
|
2024-08-08 14:11:30 -03:00
|
|
|
RUN cp target/release/xbnet /usr/local/bin/xbnet
|
|
|
|
|
2024-08-16 13:14:54 -03:00
|
|
|
# Copy the entrypoint script
|
2024-08-16 13:37:05 -03:00
|
|
|
COPY ./scripts/entrypoint.sh /entrypoint.sh
|
2024-08-09 16:21:47 -03:00
|
|
|
RUN chmod +x /entrypoint.sh
|
2024-08-08 14:11:30 -03:00
|
|
|
|
2024-08-16 13:37:05 -03:00
|
|
|
# Copy the health check script
|
2024-08-16 13:14:54 -03:00
|
|
|
COPY ./scripts/health_check.sh /health_check.sh
|
|
|
|
RUN chmod +x /health_check.sh
|
|
|
|
|
2024-08-16 13:37:05 -03:00
|
|
|
# Add healthcheck
|
|
|
|
HEALTHCHECK CMD /health_check.sh || exit 1
|