Skip to content

Commit

Permalink
docker: add docker document.
Browse files Browse the repository at this point in the history
  • Loading branch information
pymumu committed Nov 1, 2023
1 parent 4d69057 commit e5e5c99
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ddwrt|官方最新固件service页面->SmartDNS Resolver->启用。|选择界面
debian|apt-get install smartdns|
entware|ipkg update<br />ipkg install smartdns|软件源路径:<https://bin.entware.net/>
MacOS|brew update<br />brew install smartdns|软件源路径(Rust 移植版):<https://github.com/mokeyish/smartdns-rs/releases/>
docker|docker pull pymumu/smartdns | docker镜像:<https://hub.docker.com/r/pymumu/smartdns>

## 手工下载安装

Expand Down
26 changes: 26 additions & 0 deletions docs/install/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
hide:
- toc
---

# Docker

## 说明

SmartDNS提供了Docker镜像方便进行快速安装。

## 配置

创建配置文件/etc/smartdns/smartdns.conf,添加如下必须的配置项目:

```
bind [::]:53
server 8.8.8.8
server 1.1.1.1
```

## 启动镜像

```
docker run -d --name smartdns --restart=always -p 53:53/udp -v /etc/smartdns:/etc/smartdns pymumu/smartdns:latest
```
1 change: 1 addition & 0 deletions en/docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ddwrt|latest firmware. goto services page abd enable SmartDNS Resolver. |Demo: <
debian|apt-get install smartdns|
entware|ipkg update<br />ipkg install smartdns|Software source: <https://bin.entware.net/>
MacOS|brew update<br />brew install smartdns|Software source(Rust port):<https://github.com/mokeyish/smartdns-rs/releases/>
docker|docker pull pymumu/smartdns | Docker image:<https://hub.docker.com/r/pymumu/smartdns>

## Download From Release Page

Expand Down
26 changes: 26 additions & 0 deletions en/docs/install/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
hide:
- toc
---

# Docker

## Description

SmartDNS provides a Docker image for quick installation.

## Configuration

Create the configuration file /etc/smartdns/smartdns.conf and add the following configuration:

```
bind [::]:53
server 8.8.8.8
server 1.1.1.1
```

## Run image

```
docker run -d --name smartdns --restart=always -p 53:53/udp -v /etc/smartdns:/etc/smartdns pymumu/smartdns:latest
```
1 change: 1 addition & 0 deletions en/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ nav:
- ASUS firmware / Merlin firmware: 'install/asus.md'
- EntWare: 'install/entware.md'
- WSL: 'install/wsl.md'
- Docker: 'install/docker.md'
- Configuration Guides:
- Basic Configuration: 'config/basic-config.md'
- Server Configuration: 'config/server-config.md'
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ nav:
- 华硕固件 / 梅林固件: 'install/asus.md'
- EntWare: 'install/entware.md'
- WSL: 'install/wsl.md'
- Docker: 'install/docker.md'
- 配置指导:
- 基本配置: 'config/basic-config.md'
- 服务端配置: 'config/server-config.md'
Expand Down
21 changes: 21 additions & 0 deletions systemd/smartdns.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Unit]
Description=SmartDNS Server
After=network.target
Before=network-online.target
Before=nss-lookup.target
Wants=nss-lookup.target
StartLimitBurst=0
StartLimitIntervalSec=60

[Service]
Type=forking
PIDFile=/run/smartdns.pid
EnvironmentFile=/etc/default/smartdns
ExecStart=/usr/sbin/smartdns -p /run/smartdns.pid $SMART_DNS_OPTS
Restart=always
RestartSec=2
TimeoutStopSec=15

[Install]
WantedBy=multi-user.target
Alias=smartdns.service

0 comments on commit e5e5c99

Please sign in to comment.