Configuration Highlights (Docker Daemon and DNS)

Below is a deep dive into how Omarchy configures the Docker daemon and DNS resolution on a fresh Arch Linux system. This section covers the purpose, key files, configuration snippets, and workflows involved.


Index


Docker Daemon Configuration

Omarchy’s docker.sh script ensures Docker is production-ready by applying sensible defaults, avoiding runaway logs, and preventing boot-blocking.

Purpose

  • Limit Docker log growth to conserve disk space.
  • Use the host’s DNS resolver for container name resolution.
  • Enable Docker at boot and grant the installing user group-based access.
  • Prevent Docker from stalling the boot process waiting on the network.

Key Files

File Role
/etc/docker/daemon.json Core Docker daemon settings (log rotation, DNS, bridge IP).
/etc/systemd/resolved.conf.d/20-docker-dns.conf Exposes systemd-resolved stub listener to Docker containers.
/etc/systemd/system/docker.service.d/no-block-boot.conf Overrides unit dependencies to avoid boot blocking.

Configuration Details

  • Log Rotation

    {
      "log-driver": "json-file",
      "log-opts": { "max-size": "10m", "max-file": "5" },
      "dns": ["172.17.0.1"],
      "bip": "172.17.0.1/16"
    }
    

    The above JSON limits logs to 10 MiB per file with up to 5 files, sets the DNS resolver, and configures the Docker bridge IP .

  • Expose systemd-resolved

    [Resolve]
    DNSStubListenerExtra=172.17.0.1
    

    This snippet in /etc/systemd/resolved.conf.d/20-docker-dns.conf allows containers to reach the host’s stub resolver .

  • Service Override

    [Unit]
    DefaultDependencies=no
    

    Written to /etc/systemd/system/docker.service.d/no-block-boot.conf, this removes the default network-online dependency to avoid delaying boot .

Process Flow

flowchart TD
    A[Start Omarchy Installer]
    B[Create /etc/docker/daemon.json]
    C[Write systemd-resolved override]
    D[Restart systemd-resolved]
    E[Enable Docker service]
    F[Add user to docker group]
    G[Write Docker unit override]
    H[systemctl daemon-reload]
    A --> B --> C --> D --> E --> F --> G --> H

DNS Integration

Omarchy configures DNS both for the host and for Docker containers, and provides an interactive tool to switch DNS providers.

Systemd-resolved Configuration

  1. Symlink stub resolver:

    sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
    

    Ensures /etc/resolv.conf points to the systemd stub resolver .

  2. Disable multicast DNS for printers:

    [Resolve]
    MulticastDNS=no
    

    Applied via /etc/systemd/resolved.conf.d/10-disable-multicast.conf in a migration to improve printer discovery .

  3. Reset to DHCP when needed:
    Omarchy includes migrations that strip explicit DNS settings, restoring DHCP defaults while preserving .local resolution .

Interactive DNS Setup (omarchy-setup-dns)

Omarchy ships a CLI tool to switch DNS providers on demand:

#!/bin/bash
if [[ -z $1 ]]; then
  dns=$(gum choose --header "Select DNS provider" Cloudflare DHCP Custom)
else
  dns=$1
fi
case "$dns" in
  Cloudflare)
    sudo tee /etc/systemd/resolved.conf >/dev/null <<'EOF'
[Resolve]
DNS=1.1.1.1
FallbackDNS=9.9.9.9
DNSOverTLS=opportunistic
EOF
    # Prevent DHCP from overriding
    for file in /etc/systemd/network/*.network; do
      sudo sed -i '/^\[DHCPv4\]/a UseDNS=no' "$file"
      sudo sed -i '/^\[IPv6AcceptRA\]/a UseDNS=no' "$file"
    done
    sudo systemctl restart systemd-networkd systemd-resolved
    ;;
  DHCP)
    sudo tee /etc/systemd/resolved.conf >/dev/null <<'EOF'
[Resolve]
DNS=
FallbackDNS=
DNSOverTLS=no
EOF
    for file in /etc/systemd/network/*.network; do
      sudo sed -i '/^UseDNS=no/d' "$file"
    done
    sudo systemctl restart systemd-networkd systemd-resolved
    ;;
  Custom)
    echo "Enter your DNS servers (space-separated):"
    read -r dns_servers
    sudo tee /etc/systemd/resolved.conf >/dev/null <<EOF
[Resolve]
DNS=$dns_servers
FallbackDNS=9.9.9.9 149.112.112.112
EOF
    sudo systemctl restart systemd-networkd systemd-resolved
    ;;
esac

This script lives in bin/omarchy-setup-dns and lets users pick Cloudflare, DHCP, or Custom DNS servers interactively .


By orchestrating these configurations, Omarchy ensures Docker works reliably out of the box, containers resolve names correctly, and the system boots without network-online hangups.