ganesshkumar
ganesshkumar

Reputation: 1377

Configuring same ports with different protocols in Azure Container Instance

I am trying to set up pi-hole in Azure Container Instance. Here is the link to the docker-compose file of pi-hole.

Following the YAML reference for the Azure Container Instance, I am trying to convert this docker-compose file.

Here is the YAML file I have populated.

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

When I give same ports with different protocols (TCP 53 and UDP 53), like how it was given in the docker-compose file, the creation of the container group fails with the following error

> az container create -g myResourceGroup -f container.yaml
Duplicate ports '53' found in container group 'pi-hole' container 'pihole'.

How should I enter the ports to configure the port 53 in TCP and UDP like the sample docker-compose file.

Upvotes: 2

Views: 985

Answers (1)

Charles Xu
Charles Xu

Reputation: 31414

Unfortunately, the port for ACI to exposed to the Internet should be a unique one, it means the port only can appear one time. And I know that you want the port 53 allowing both TCP and UDP protocol, but it does not support in ACI currently.

If you do not mind, the VM can help you achieve your purpose.

Upvotes: 1

Related Questions