docker-pi-hole README

The project's README from github.com/pi-hole/docker-pi-hole. As one markdown file: README.md.

Docker Pi-hole

Build Status Docker Stars Docker Pulls

Pi-hole website
Network-wide ad blocking via your own Linux hardware

Pi-hole website | Documentation | Discourse Forum | Donate


Upgrade Notes

[!NOTE] Using Watchtower?
See the Note on Watchtower in our documentation
.

[!TIP] Some users have reported issues with using the --privileged flag on 2022.04 and above.
TL;DR, don't use that mode, and be explicit with the permitted caps (if needed) instead.

Quick Start

Using Docker-compose:

  1. Copy the below docker compose example and update as needed:
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      # DNS Ports
      - "53:53/tcp"
      - "53:53/udp"
      # Default HTTP Port
      - "80:80/tcp"
      # Default HTTPs Port. FTL will generate a self-signed certificate
      - "443:443/tcp"
      # Uncomment the line below if you are using Pi-hole as your DHCP server
      #- "67:67/udp"
      # Uncomment the line below if you are using Pi-hole as your NTP server
      #- "123:123/udp"
    environment:
      # Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g:
      TZ: 'Europe/London'
      # Set a password to access the web interface. Not setting one will result in a random password being assigned
      FTLCONF_webserver_api_password: 'correct horse battery staple'
      # If using Docker's default `bridge` network setting the dns listening mode should be set to 'ALL'
      FTLCONF_dns_listeningMode: 'ALL'
    # Volumes store your data between container upgrades
    volumes:
      # For persisting Pi-hole's databases and common configuration file
      - './etc-pihole:/etc/pihole'
      # Uncomment the below if you have custom dnsmasq config files that you want to persist. Not needed for most starting fresh with Pi-hole v6. If you're upgrading from v5 you and have used this directory before, you should keep it enabled for the first v6 container start to allow for a complete migration. It can be removed afterwards. Needs environment variable FTLCONF_misc_etc_dnsmasq_d: 'true'
      #- './etc-dnsmasq.d:/etc/dnsmasq.d'
    cap_add:
      # See https://docs.pi-hole.net/docker/#note-on-capabilities
      # Required if you are using Pi-hole as your DHCP server, else not needed
      - NET_ADMIN
      # Required if you are using Pi-hole as your NTP client to be able to set the host's system time
      - SYS_TIME
      # Optional, if Pi-hole should get some more processing time
      - SYS_NICE
    restart: unless-stopped
  1. Run docker compose up -d to build and start pi-hole (Syntax may be docker-compose on older systems).

[!NOTE] Volumes are recommended for persisting data across container re-creations for updating images.

Automatic Ad List Updates

cron is baked into the container and will grab the newest versions of your lists and flush your logs. This happens once per week in the small hours of Sunday morning.

Documentation

For more detailed information, please refer to our documentation:

Docker tags and versioning

The primary docker tags are explained in the following table. Click here to see the full list of tags. See GitHub Release notes to see the specific version of Pi-hole Core, Web, and FTL included in the release.

The Date-based (including incremented "Patch" versions) do not relate to any kind of semantic version number, rather a date is used to differentiate between the new version and the old version, nothing more.

Release notes will always contain full details of changes in the container, including changes to core Pi-hole components.

tag description
latest Always the latest release
2022.04.0 Date-based release
nightly Built and pushed whenever there are changes on the development branch and additionally produced by the scheduled nightly job. These are the most experimental development images and may change frequently

User Feedback

Please report issues on the GitHub project when you suspect something docker related. Pi-hole or general docker questions are best answered on our user forums

docker-pi-hole (pi-hole/docker-pi-hole)

Searching Database…

这是什么?这是 Pi-hole 的官方 Docker 镜像。Pi-hole 是一款全网络广告拦截工具,让你可以在自己的 Linux 硬件上以容器形式运行它,而不必直接安装到操作系统中。
这是一个应用,还是对现有工具的打包?这是一个容器镜像,它封装了现有的 Pi-hole 软件(Core、Web 管理面板和 FTL DNS 引擎),让你可以用 Docker 运行,而无需裸机安装。
我该如何让它运行起来?复制提供的 docker-compose 示例,根据需要进行调整,然后运行 'docker compose up -d',以构建并启动容器。
我需要 Docker Compose,还是可以直接用普通的 docker run?快速入门是按 docker-compose 编写的,并注明在较旧的系统上命令语法可能是 'docker-compose'。Docker 或 Docker Compose 是唯一真正的前提条件。
安装时有哪些需要注意的坑?2022.04 及以上版本请避免使用 --privileged 参数,应明确指定你实际需要的能力(capabilities)。
我的广告列表会自动保持更新吗?会的。容器内置的一个 cron 任务会在每周日清晨拉取最新版本的广告列表,并清空日志。
不同的 Docker 标签分别是什么意思?'latest' 是最新的稳定版本;类似 '2022.04.0' 这样基于日期的标签会固定到某个特定版本;'nightly' 则会在开发分支每次有变更时构建,另外还有一个定时的夜间任务,用于构建最具实验性的版本。
容器本身的问题应该在哪里反馈?与 Docker 相关的问题请在 GitHub 项目上报告;一般性的 Pi-hole 或 Docker 使用问题,更适合到 Pi-hole 用户论坛提问。
容器更新后,我的设置还会保留吗?会的。只要你挂载了用于持久化的卷,更新到新镜像并重新创建容器时,你的配置和数据都会保留。
Creator
pi-hole
Size
2.5 MB
Stars
11.7K
Age
10y
Commits · 90 Days