Skip to content

Commit

Permalink
added nmbd
Browse files Browse the repository at this point in the history
  • Loading branch information
markdegrootnl committed Jul 25, 2022
1 parent 858b2ec commit 7760604
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nmbd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM alpine:3.15.5

RUN apk add --no-cache samba-server

COPY start.sh /start.sh

EXPOSE 137/udp

CMD ["/start.sh"]
24 changes: 24 additions & 0 deletions nmbd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# nmbd

Run Samba's NMBD inside docker to respond to NETBIOS queries

## Usage

Run the container:

```bash
docker run -it --rm -p 137:137/udp \
-e NETBIOS_NAME=MYHOSTNAME \
-e NETBIOS_WORKGROUP=MYWORKGROUP \
markdegroot/nmbd
```
The following optional parameters can be configured using environment variables:
- NETBIOS_NAME
- NETBIOS_WORKGROUP

## Building

Build the container using:
```bash
docker build -t markdegroot/nmbd .
```
7 changes: 7 additions & 0 deletions nmbd/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
set -e

/usr/sbin/nmbd -i \
"--option=netbios name = ${NETBIOS_NAME:-$HOSTNAME}" \
"--option=workgroup = ${NETBIOS_WORKGROUP:-WORKGROUP}" \
"--option=local master = no"

0 comments on commit 7760604

Please sign in to comment.