多次使用码头,我熟悉码头网络和端口映射的概念。然而,我还没有在网上找到任何你想把这两者混合在一起的案例。希望有人能帮我。
我在很多情况下都使用Traefik。我也有圆孔软件作为私人DNS.我想标准化Traefik背后的所有服务使用TLS和自定义(内部)域。圆孔管理界面与Traefik完美地协同工作。
边缘路由器后面的圆孔最大的问题是,对接者使用NAT作为内部网络.因此圆孔无法看到DNS请求是从哪里发出的。唯一要克服的就是将DNS端口(53 & 853)直接映射到主机,我猜是这样(绕过内部Traefik网络,绕过任何NAT)。

我可以将圆孔容器附加到多个网络,但是我如何能够将:80附加到Traefik网络,将:53附加到主机网络?
发布于 2021-12-29 09:04:55
最终,这是相当简单的,虽然我认为这是行不通的:只要发布端口,而π孔容器连接到Traefik网络。
这是我使用的Ansible配置:
- name: Create the pihole container
docker_container:
name: "{{ pihole_docker_container }}"
image: "{{ pihole_docker_tag }}"
pull: yes
restart_policy: unless-stopped
networks_cli_compatible: yes
networks:
- name: "{{ traefik_docker_network }}"
volumes:
- "{{ pihole_config_dir }}:/etc/pihile/"
- "{{ pihole_dnsmasq_dir }}:/etc/dnsmasq.d/"
env:
TZ: "{{ pihole_tz }}"
WEBPASSWORD: ""
DNS1: "{{ pihole_container_dns1 }}"
DNS2: "{{ pihole_container_dns2 }}"
REV_SERVER: "{{ pihole_server_rev }}"
REV_SERVER_DOMAIN: "{{ pihole_server_domain }}"
REV_SERVER_TARGET: "{{ pihole_server_gateway }}"
REV_SERVER_CIDR: "{{ pihole_server_subnet }}"
dns_servers:
- 127.0.0.1
- "{{ pihole_container_dns1 }}"
ports:
- "53:53/tcp"
- "53:53/udp"
- "853:853"
labels:
traefik.enable: "true"
traefik.http.routers.pihole.entrypoints: "websecure"
traefik.http.routers.pihole.rule: "Host(`{{ pihole_public_domain }}`)"
traefik.http.routers.pihole.middlewares: "pihole-admin"
traefik.http.routers.pihole.service: "pihole"
traefik.http.routers.pihole.tls: "true"
traefik.http.routers.pihole.tls.certresolver: "le"
traefik.http.middlewares.pihole-admin.addprefix.prefix: "/admin"
traefik.http.routers.pihole_http.entrypoints: "web"
traefik.http.routers.pihole_http.rule: "Host(`{{ pihole_public_domain }}`)"
traefik.http.routers.pihole_http.middlewares: "redirect-to-https"
traefik.http.services.pihole.loadBalancer.server.port: "80"https://stackoverflow.com/questions/69267953
复制相似问题