Skip to content

Inconsistent Docker usage commands #4624

@mitchplze

Description

@mitchplze

Edited for clarity

Hello,

The NetBird management UI seems to provide convenient docker run commands for copy/pasting that are contrary to the current NetBird documentation and other discussions.

Image

Currently in NetBird 'create setup key' wizard ❌

The copy/paste widget provides:

docker run --rm -d \
 --cap-add=NET_ADMIN \
 -e NB_SETUP_KEY=XXXXXX \
 -v netbird-client:/var/lib/netbird \
 -e NB_MANAGEMENT_URL=https://net.mynetwork.com \
 netbirdio/netbird:latest

Currently in NetBird 'add peer' wizard ❌

The copy/paste widget provides:

docker run --rm -d \
 --cap-add=NET_ADMIN \
 -e NB_SETUP_KEY=SETUP_KEY \
 -v netbird-client:/var/lib/netbird \
 -e NB_MANAGEMENT_URL=https://net.mynetwork.com \
 netbirdio/netbird:latest

Currently in NetBird documentation

From: https://docs.netbird.io/how-to/installation/docker

NetBird makes use of eBPF and raw sockets, therefore to guarantee the client software functionality, we recommend adding the flags --cap-add=SYS_ADMIN and --cap-add=SYS_RESOURCE for docker clients. The experience may vary depending on the docker daemon, operating system, or kernel version.

The official example given is:

docker run --rm --name PEER_NAME --hostname PEER_NAME --cap-add=NET_ADMIN --cap-add=SYS_ADMIN --cap-add=SYS_RESOURCE -d -e NB_SETUP_KEY=<SETUP KEY> -v netbird-client:/var/lib/netbird netbirdio/netbird:latest

Further, the Docker example linked also references the above usage.

Confusion

The wizards are:

  • not adding the SYS_ADMIN capability
  • not adding the SYS_RESOURCE capability
  • not adding network_mode: host capability
  • not adding privileged: true capability
  • maybe: not adding [NB_USE_NETSTACK_MODE](NB_USE_NETSTACK_MODE not documented docs#449) capability

The copy/paste value provided by the two wizards are what I have used 95% of the time to deploy a node, and only just realized the official docs are different.

This is undoubtedly possibly causing a degraded experience with my nodes, and I'm sure others have ran into this too.

Less importantly, the wizards are:

  • not setting the hostname, so a random name ends up joining your network (this is possibly unavoidable)
  • not naming the container, so it cannot be easily found in the future (like with docker rm netbird -f)

IMO there should be consistent Docker usage that is officially documented, to offer the best experience.

I'm super happy to help out if possible!

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions