Table of Contents

About

wsdd2 is a discovery service meant to supersede avahi/zeroconf for samba created by Netgear.

Usage

Checkout the source from the Subversion repository by issuing:

svn co https://svn.grimore.org/docker/build/wsdd2

Change into the downloaded wsdd2 directory and execute:

docker build -t myregistry:5000/wsdd2:latest .

where:

After the image has finished building, the image can be pushed onto the registry:

docker push myregistry:5000/wsdd2:latest

Running

wsdd2 should be ran in host networking mode which rules out a Docker swarm. One way to do so is to just create a SystemD service file. For example, the following file can be placed at /etc/systemd/system/docker-wsdd2.service:

[Unit]
Description=WSDD/LLMNR Discovery/Name Service Daemon
After=docker.service
Requires=docker.service
StartLimitIntervalSec=0

[Service]
Restart=always
RestartSec=5s
ExecStartPre=/usr/bin/docker pull wizardrysteamworks/wsdd2:latest
ExecStart=/usr/bin/docker run --name=wsdd2 \
  --rm \
  --interactive \
  --user 0:0 \
  --privileged \
  --net=host \
  -p 3702:3702 \
  -p 3702:3702/udp \
  -p 5355:5355 \
  -p 5355:5355/udp \
  -e HOSTNAME=docker1 \
  -e WORKGROUP=WORKGROUP \
  wizardrysteamworks/wsdd2:latest
ExecStop=/usr/bin/docker rm -f wsdd2
TimeoutSec=300

[Install]
WantedBy=multi-user.target

enabled with:

systemctl enable docker-wsdd2.service

and then started with:

systemctl start docker-wsdd2.service

Source

FROM debian:bullseye-slim
 
# update package manager
RUN  apt-get update -y && \
     apt-get upgrade -y && \
     apt-get dist-upgrade -y && \
     apt-get -y autoremove && \
     apt-get clean
 
# install required packages
RUN apt-get install -y \
    build-essential \
    musl-dev \
    git
 
RUN mkdir /tmp/kitchen
WORKDIR /tmp/kitchen/
RUN git clone https://github.com/Netgear/wsdd2.git && \
    cd wsdd2 && \
    make && \
    mkdir -p /usr/local/sbin/ && \
    cp wsdd2 /usr/local/sbin/
 
WORKDIR /tmp
RUN rm -rf /tmp/kitchen
 
# remove packages that will not be used
RUN apt-get purge -y \
    build-essential \
    git && \
    apt-get autoremove -y
 
EXPOSE 3702 3702/udp 5355 5355/udp
 
ENTRYPOINT /usr/local/sbin/wsdd2 -N $HOSTNAME -G ${WORKGROUP:-WORKGROUP}