Skip to content

Commit

Permalink
docs: add docker-compose configure
Browse files Browse the repository at this point in the history
  • Loading branch information
dnomd343 committed Mar 29, 2023
1 parent 6cda2c7 commit 685488f
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,28 @@ docker run -dt \
dnomd343/cleardns
```

或使用以下等效 `docker-compose` 配置:

```yml
version: '3'
services:
cleardns:
hostname: cleardns
container_name: cleardns
image: dnomd343/cleardns
network_mode: bridge
restart: always
tty: true
ports:
- '53:53'
- '80:80'
- '53:53/udp'
volumes:
- ./:/cleardns/
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
```

</details>

<details>
Expand Down Expand Up @@ -443,6 +465,24 @@ docker run -dt --network host \
dnomd343/cleardns
```

或使用以下等效 `docker-compose` 配置:

```yml
version: '3'
services:
cleardns:
hostname: cleardns
container_name: cleardns
image: dnomd343/cleardns
network_mode: host
restart: always
tty: true
volumes:
- ./:/cleardns/
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
```

</details>

<details>
Expand All @@ -467,6 +507,7 @@ $ docker network create -d macvlan \
启动 ClearDNS 容器:

```bash
# privileged 权限可选
docker run -dt --network macvlan \
--restart always --privileged \
--name cleardns --host cleardns \
Expand All @@ -477,6 +518,32 @@ docker run -dt --network macvlan \
dnomd343/cleardns
```

或使用以下等效 `docker-compose` 配置:

```yml
version: '3'
services:
cleardns:
hostname: cleardns
container_name: cleardns
image: dnomd343/cleardns
privileged: true
restart: always
tty: true
volumes:
- ./:/cleardns/
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
macvlan:
ipv4_address: {IPv4地址}
ipv6_address: {IPv6地址}
networks:
macvlan:
external: true
```

> 以下配置旨在让宿主机能够使用 ClearDNS ,若无此需求可以跳过

宿主机网络更改配置,以下示例基于 Debian 系发行版:
Expand Down

0 comments on commit 685488f

Please sign in to comment.