43 lines
1.2 KiB
Docker
43 lines
1.2 KiB
Docker
FROM rust:latest
|
|
|
|
# Install necessary packages including OpenSSH Server
|
|
RUN apt-get update && apt-get install -y \
|
|
openssh-server \
|
|
libudev-dev \
|
|
iproute2 \
|
|
iputils-ping \
|
|
net-tools \
|
|
bridge-utils \
|
|
iptables \
|
|
traceroute \
|
|
nmap \
|
|
tcpdump \
|
|
util-linux \
|
|
bsdmainutils \
|
|
vim \
|
|
openssh-server \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Configure SSH for root login and password authentication
|
|
RUN mkdir /var/run/sshd \
|
|
&& sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
|
|
&& sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
|
|
|
# Clone and build xbnet
|
|
RUN git clone https://github.com/jgoerzen/xbnet.git /usr/src/xbnet
|
|
WORKDIR /usr/src/xbnet
|
|
RUN cargo build --release
|
|
RUN cp target/release/xbnet /usr/local/bin/xbnet
|
|
|
|
# Copy scripts and make them executable
|
|
COPY ./scripts/entrypoint.sh /entrypoint.sh
|
|
COPY ./scripts/set-env-vars.sh /set-env-vars.sh
|
|
COPY ./scripts/health-check.sh /health-check.sh
|
|
COPY ./scripts/debug/host-setup-docker.sh /host-setup-docker.sh
|
|
RUN chmod +x /entrypoint.sh /set-env-vars.sh /health-check.sh /host-setup-docker.sh
|
|
|
|
# Add healthcheck
|
|
HEALTHCHECK CMD /health-check.sh || exit 1
|
|
|
|
EXPOSE 22
|