Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container updates #62

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

@mattcen mattcen Dec 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get the impression that there is a "standard" port recommended for a supernode, otherwise I'd have put in an EXPOSE 1234/udp here, too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a default bind port of 7654, so that could be exposed


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