【发布时间】:2026-01-29 03:05:01
【问题描述】:
我正在尝试在 Azure 容器实例中设置 pi-hole。这是pi-hole的docker-compose文件的链接。
按照 Azure 容器实例的 YAML reference,我正在尝试转换此 docker-compose 文件。
这是我填充的 YAML 文件。
name: pi-hole
apiVersion: '2018-10-01'
location: westus2
tags: {}
properties:
containers:
- name: pihole
properties:
image: pihole/pihole:latest
ports:
- protocol: TCP
port: 53
- protocol: UDP
port: 53
- protocol: UDP
port: 67
- protocol: TCP
port: 80
- protocol: TCP
port: 443
environmentVariables:
- name: TZ
value: Asia/Kolkata
resources: # Resource requirements of the instance
requests:
memoryInGB: 1
cpu: 1
restartPolicy: Always
ipAddress:
ports:
- protocol: TCP
port: 53
- protocol: UDP
port: 53
- protocol: UDP
port: 67
- protocol: TCP
port: 80
- protocol: TCP
port: 443
type: public
dnsNameLabel: my-pihole
osType: Linux
当我为相同的端口提供不同的协议(TCP 53 和 UDP 53)时,就像在 docker-compose 文件中给出的那样,容器组的创建失败并出现以下错误
> az container create -g myResourceGroup -f container.yaml
Duplicate ports '53' found in container group 'pi-hole' container 'pihole'.
我应该如何输入端口来配置 TCP 和 UDP 中的端口 53,就像示例 docker-compose 文件一样。
【问题讨论】:
-
还有问题吗?它解决了你的问题吗?如果它对你有用,请接受它。无论如何,只要给出回应。
标签: azure docker azure-container-instances