
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
This is a alpine-linux base samba 4 AD DC image. https://img.shields.io/docker/cloud/automated/p3tr/samba-dc.svg](https://hub.docker.com/r/p3tr/samba-dc) https://img.shields.io/docker/cloud/build/p3tr/samba-dc.svg](https://hub.docker.com/r/p3tr/samba-dc)
git clone https://github.com/p3t/docker-samba-dc.git cd docker-samba-dc docker build -t p3t/samba-dc .
The samba-tool which is used to setup the domain tries to modify the ACL of the sys_vol, which leads to an error,
when the container is not run with --privileged=true.
The priviledged option is not required to run the DC after the setup (once the config has been created).
docker volume create samba docker run --rm \ --privileged=true \ --mount source=samba,target=/samba \ -eDOMAIN=your-domain.local \ -eNO_COMPLEXITY=true \ -eADMIN_PASSWORD=<your-pass> \ -eDNS_FORWARD=192.168.2.1 \ p3t/samba-dc setup
There are multiple options to make a container accessible from the network. One option is to start the container in the host-network I decided to use a https://docs.docker.com/network/macvlan/.
Note: You have to make sure, that the IP-addesses in the provided range are not in-use (e.g. used by a DHCP server):
#!/bin/bash # # Creates a docker macvlan - subnet/gateway are the same as your lan settings. # Choose an ip-range not used by DHCP # readonly SUBNET='192.168.2.0/24' readonly GATEWAY='192.168.2.1' # Range of 4 addresses starting at 192.168.2.160 readonly START_IP=${1:-192.168.2.160} readonly IPRANGE="${START_IP}/30" readonly HOST_AUXIP=${3:-$START_IP} readonly SUBIFNO=${2:-160} readonly PARENTIF="enp2s0" readonly NETNAME="macvlan-${PARENTIF}" # Note about 802.1q trunked bridge macvlans: # I assume that you need to have a VLAN capable router or layer-3 switch in order to get it working # As I do not have such kind of hardware my containers couldn't connect to the outside world # and they where not reachable from anywhere echo "Creating docker network '${NETNAME}'..." docker network create -d macvlan -o parent=${PARENTIF} \ --subnet ${SUBNET} \ --gateway ${GATEWAY} \ --ip-range ${IPRANGE} \ --aux-address "host=${HOST_AUXIP}" \ ${NETNAME} readonly VDEF_NAME="${PARENTIF}.${SUBIFNO}" echo "Creating sub-dev '${VDEF_NAME}' for host -> macvlan-routing..." sudo ip link add ${VDEF_NAME} link ${PARENTIF} type macvlan mode bridge sudo ip addr add ${HOST_AUXIP}/32 dev ${VDEF_NAME} sudo ip link set ${VDEF_NAME} up sudo ip route add ${IPRANGE} dev ${VDEF_NAME} echo "done"
Example:
docker run -d --rm \ -v samba:/samba \ --network macvlan-enp2s0 \ --name sambaDC \ --hostname sambaDC \ --ip 192.168.2.161 \ --mac-address aa:bb:cc:ee:44:55 \ p3t/samba-dc start
You can directly start an interactive shell and run the entrypoint.sh or parts of it manually on the command pro***:
docker run -it \ --privileged=true \ --mount source=samba,target=/samba \ -eDOMAIN=your-domain.local -eNO_COMPLEXITY=true -eADMIN_PASSWORD=<your-pass> \ p3t/samba-dc ash
Thanks to https://github.com/Fmstrat/samba-domain I took this project as initial inspiration.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 p3tr/samba-dc 相关的常用 Docker 镜像,适用于 不同场景 等不同场景: