Skip to content

diegogslomp/samba-ad-dc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

samba-ad-dc

dockerhub gh-actions gh-actions gh-actions gh-actions

Samba Active Directory Domain Controller Docker Image

Deploy a new domain on a Linux host

docker run -d --privileged \
  --restart=unless-stopped --network=host \
  -e REALM='SAMDOM.EXAMPLE.COM' \
  -e DOMAIN='SAMDOM' \
  -e ADMIN_PASS='Passw0rd' \
  -e DNS_FORWARDER='8.8.8.8' \
  -v dc1_etc:/usr/local/samba/etc \
  -v dc1_private:/usr/local/samba/private \
  -v dc1_var:/usr/local/samba/var \
  --name dc1 --hostname DC1 diegogslomp/samba-ad-dc

Update the /etc/resolv.conf and /etc/hosts, replacing host_ip

# /etc/resolv.conf
search samdom.example.com
nameserver host_ip

# /etc/hosts
127.0.0.1     localhost
host_ip       DC1.samdom.example.com     DC1

Logs and tests

docker logs dc1 -f
docker exec dc1 samba-tests
docker exec dc1 samba-tool user list
docker exec -it dc1 samba-tool user create someuser

On Windows (no published ports)

docker run -d --privileged `
  --restart=unless-stopped `
  -e REALM='SAMDOM.EXAMPLE.COM' `
  -e DOMAIN='SAMDOM' `
  -e ADMIN_PASS='Passw0rd' `
  -e DNS_FORWARDER='8.8.8.8' `
  -e BIND_NETWORK_INTERFACES=false `
  -v dc1_etc:/usr/local/samba/etc `
  -v dc1_private:/usr/local/samba/private `
  -v dc1_var:/usr/local/samba/var `
  --name dc1 --hostname DC1 diegogslomp/samba-ad-dc

Multiple DC build and tests (no published ports)

git clone --single-branch https://github.com/diegogslomp/samba-ad-dc
cd samba-ad-dc
# Download and rename samba tar file
curl -o samba.tar.gz https://download.samba.org/pub/samba/samba-latest.tar.gz
docker compose build
docker compose up -d
docker compose logs -f
for dc in dc{1,2,3,4}; do docker compose exec $dc samba-tests; done

To Do

Links