Skip to content

Commit

Permalink
build: added example docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Baumgaertner committed Feb 12, 2024
1 parent 4a6e4cc commit 2d6694b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
35 changes: 35 additions & 0 deletions dockerfiles/Dockerfile.debian-bookwork-slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ARG ARCH=

FROM ${ARCH}rust:1.75 as builder

WORKDIR /root
#RUN rustup component add rustfmt
#RUN git clone https://github.com/dtn7/dtn7-rs && cd dtn7-rs && \
# git checkout 43fac1cc2ead3a8fa9e1825f8265a77dd9298daa && \
COPY . dtn7
RUN cd dtn7 && \
cargo install --locked --bins --examples --root /usr/local --path examples && \
cargo install --locked --bins --examples --root /usr/local --path core/dtn7
RUN cargo install --locked --bins --examples --root /usr/local dtn7-plus --git https://github.com/dtn7/dtn7-plus-rs --rev 010202e56 dtn7-plus

FROM debian:bookworm-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt install net-tools iproute2 iputils-ping tcpdump wget curl -y

WORKDIR /opt
# RUN wget https://github.com/dtn7/dtn7-rs/releases/download/v0.19.0/dtn7-0.19.0-x86_64-unknown-linux-musl.tar.gz && \
# mkdir -p /opt/dtn7 && \
# tar -xvf dtn7-0.19.0-x86_64-unknown-linux-musl.tar.gz -C /opt/dtn7 --strip-components=1 && \
# rm dtn7-0.19.0-x86_64-unknown-linux-musl.tar.gz && \
# cp /opt/dtn7/bin/* /usr/local/bin && \
# cp /opt/dtn7/examples/* /usr/local/bin

COPY --from=builder /usr/local/bin/* /usr/local/bin/

COPY dockerfiles/start_dtnd /usr/local/bin/start_dtnd

HEALTHCHECK --interval=60s --timeout=10s --start-period=15s --retries=3 \
CMD curl --fail http://localhost:3000 || exit 1
ENTRYPOINT [ "start_dtnd" ]
3 changes: 3 additions & 0 deletions dockerfiles/start_dtnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

dtnd -n $(hostname) $@

0 comments on commit 2d6694b

Please sign in to comment.