39 lines
843 B
Docker
39 lines
843 B
Docker
FROM rust:latest
|
|
|
|
# Install necessary packages
|
|
RUN apt-get update && apt-get install -y \
|
|
libudev-dev \
|
|
iproute2 \
|
|
iputils-ping \
|
|
net-tools \
|
|
bridge-utils \
|
|
iptables \
|
|
traceroute \
|
|
nmap \
|
|
tcpdump \
|
|
util-linux \
|
|
bsdmainutils \
|
|
vim \
|
|
&& 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
|
|
RUN cargo build --release
|
|
|
|
# Copy the built binary to /usr/local/bin
|
|
RUN cp target/release/xbnet /usr/local/bin/xbnet
|
|
|
|
# Copy the entrypoint script
|
|
COPY ./scripts/entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
# Copy the health check script
|
|
COPY ./scripts/health_check.sh /health_check.sh
|
|
RUN chmod +x /health_check.sh
|
|
|
|
# Add healthcheck
|
|
HEALTHCHECK CMD /health_check.sh || exit 1
|