Skip to content

Commit 8d2f6ec

Browse files
committed
Issue #46 clarify capability requirements for samba-dc
1 parent 623f2cc commit 8d2f6ec

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

images/samba-dc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The most-common directives can be specified in environment variables as shown be
99
Basic requirements:
1010

1111
* A Domain Controller must have a static IP address and persistent DNS entry
12-
* This container must be run in network_mode:host
12+
* This container must be run in network_mode:host, and with cap_add:CAP_SYS_ADMIN privs
1313
* A NETBIOS_NAME or hostname must be specified, which becomes the netbios name.
1414

1515
The directories /etc/samba and /var/lib/samba must be mounted as persistent volumes. If /var/lib/samba is empty, the "provision" or "join" action specified in DOMAIN_ACTION variable will be taken.

images/samba-dc/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ services:
55
image: ${REGISTRY_URI:-instantlinux}/samba-dc:latest
66
restart: always
77
network_mode: host
8+
cap_add:
9+
- CAP_SYS_ADMIN
810
hostname: ${SAMBADC_HOSTNAME:-dc.example.com}
911
environment:
1012
DOMAIN_ACTION: join

images/samba-dc/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ if [ ! -f /etc/timezone ] && [ ! -z "$TZ" ]; then
1414
fi
1515

1616
if [ ! -f /var/lib/samba/registry.tdb ]; then
17+
if [ ! -f /run/secrets/$ADMIN_PASSWORD_SECRET ]; then
18+
echo 'Cannot read secret $ADMIN_PASSWORD_SECRET in /run/secrets'
19+
exit 1
20+
fi
1721
ADMIN_PASSWORD=$(cat /run/secrets/$ADMIN_PASSWORD_SECRET)
1822
if [ "$BIND_INTERFACES_ONLY" == yes ]; then
1923
INTERFACE_OPTS="--option=\"bind interfaces only=yes\" \

0 commit comments

Comments
 (0)