Docker image for running a Samba Active Directory domain
Find a file
2025-11-27 13:23:16 +01:00
.gitignore Ignore Eclipse .project file 2025-11-03 17:26:45 +01:00
Dockerfile Blijkbaar moet samba zelf ook als package want anders geeft domain join 2025-11-27 13:23:16 +01:00
init-dc.sh hope this works 2025-11-27 10:22:14 +01:00
README.md Switch from debian to alpine, added certificate env's 2025-11-27 09:52:44 +01:00
samba-provision.sh fix bug that did not create the certificate smb.conf entries 2025-11-27 11:54:49 +01:00
vars.sh back to bash 2025-11-27 10:15:53 +01:00

Docker container for using a Samba Active Directory server in your network.

As a Samba domain controller needs it's own fixed IP in the network, this container needs to run privileged as root using a macvlan network.

The container needs 3 environment variables to run.

Environment variable Description Example
DOMAIN_FQDN The internal domain name used on the network. This can be a .internal domain. companyname.internal
DOMAIN_NETBIOS The Netbios domain name for the AD domain. Username login will become <DOMAIN_NETBIOS>\Administrator for example PALANTHIR
DNSFORWARDER The DNS server the Samba DNS server uses as DNS forwarder 1.1.1.1

Installation

Create the volumes needed, for example:

sudo podman volume create ad_dc1_conf
sudo podman volume create ad_dc1_sambalib

build the image

sudo podman build -t samba-ad-docker --network host https://git.palanthir.nl/palanthir/samba-ad-docker.git

sudo podman build -t samba-ad-docker .

start the container

sudo podman run --name ad_dc1
-e DOMAIN_FQDN=
-e DOMAIN_NETBIOS=
-e DNSFORWARDER=
-e TLS_KEY_FILE=
-e TLS_CERT_FILE=
-e TLS_CA_FILE=
--network=LANnetwork --ip= --ip6=
--replace --privileged -d --hostname=
-v ad_dc1_conf:/etc/samba/config
-v ad_dc1_sambalib:/var/lib/samba
localhost/samba-ad-docker

Set the Administrator password

podman exec -it <container name> samba-tool user setpassword Administrator

Handy command to view all DNS hosts in the AD domain:

samba-tool dns query localhost <domain name> @ ALL -U Administrator