Skip to content

Commit

Permalink
Merge pull request #62 from mattcen/container-updates
Browse files Browse the repository at this point in the history
Container updates
  • Loading branch information
hamishcoleman authored Jan 2, 2025
2 parents 91c05f0 + 85df628 commit b92fe5d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .containerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git/
LICENSES/
debian/
doc/
packages/
thirdparty/
wireshark/
33 changes: 28 additions & 5 deletions doc/Containerfile.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,36 @@
# -f doc/Containerfile.example \
# .
#
# Note that podman must be run in rootful mode for the build tests to pass.
# To build in rootless mode:
# podman build \
# --build-arg SKIP_TESTS=1 \
# -t=n3n \
# -f doc/Containerfile.example \
# .
#
# Start a n3n session with:
# podman run \
# --rm \
# -it \
# --name=n3n \
# --device=/dev/net/tun \
# --cap-add=NET_ADMIN \
# -v $PWD/n3n:/etc/n3n/ \
# -v "$PWD"/n3n:/etc/n3n/ \
# n3n start -vvvv
#
# Note that the build could be done without the --device and --cap-add if
# the `make test` is omitted
# Start an n3n supernode with the following, where 1234 is the port
# configured in your supernode config file:
# podman run
# --rm \
# -it \
# --name=n3n-supernode \
# -p1234:1234/udp \
# --device=/dev/net/tun \
# --cap-add=NET_ADMIN \
# -v "$PWD"/n3n:/etc/n3n/ \
# --entrypoint=/n3n-supernode \
# n3n start -vvvv

FROM docker.io/library/debian:12 AS builder

Expand All @@ -33,13 +52,17 @@ COPY . .
RUN \
./autogen.sh && \
./configure && \
make clean all && \
make test
make clean all

ARG SKIP_TESTS=0

RUN if [ 0 -eq "$SKIP_TESTS" ]; then make test; fi


FROM docker.io/library/debian:12

COPY --from=builder /n3n/apps/n3n-edge /n3n-edge
COPY --from=builder /n3n/apps/n3n-supernode /n3n-supernode

VOLUME [ "/etc/n3n" ]
ENTRYPOINT ["/n3n-edge"]
Expand Down

0 comments on commit b92fe5d

Please sign in to comment.