services-xbee_net/Dockerfile

29 lines
637 B
Docker
Raw Normal View History

# Use an official Rust image as the base
FROM rust:latest
# Install dependencies
RUN apt-get update && apt-get install -y \
libudev-dev \
iproute2 \
iputils-ping \
&& 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
# Create the entrypoint script
RUN echo '#!/bin/bash\n\
set -e\n\
exec "$@"' > /entrypoint.sh \
&& chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]