# No audio when running on Docker.

**URL:** <https://mediasoup.discourse.group/t/no-audio-when-running-on-docker/4787>\
**Category:** Deployment & Scalability\
**Created:** [December 27, 2022, 4:10am UTC](https://mediasoup.discourse.group/t/no-audio-when-running-on-docker/4787 "2022-12-27T04:10:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MinhVuAlinco](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/minhvualinco/32/1875_2.png) [@MinhVuAlinco](https://mediasoup.discourse.group/u/MinhVuAlinco)\
**Post date:** [December 27, 2022, 4:10am UTC](https://mediasoup.discourse.group/t/no-audio-when-running-on-docker/4787/1 "2022-12-27T04:10:05Z")

</div>

Hi everyone.  
I dev mediasoup server base on [GitHub - Dirvann/mediasoup-sfu-webrtc-video-rooms: A simple video conferencing example using the mediasoup sfu](https://github.com/Dirvann/mediasoup-sfu-webrtc-video-rooms)  
When I run in localhost. everything is good.  
But when I run server on docker(window 11 , Docker Desktop), no audio playing on receiver phone.  
It seems like some rtc port is not working  
Here is server log:

```auto
Produce {
  type: 'audio',
  name: 'testaccount1',
  id: '09497751-5456-471e-9a00-f92c12574a99'
}
Consuming {
  name: 'testaccount3',
  producer_id: '09497751-5456-471e-9a00-f92c12574a99',
  consumer_id: '1709d577-8021-4f23-acb3-43779763d85c'
}

```

Here is receiver client log:

```auto
 LOG New producers [{"producer_account_name": "Account 1", "producer_id": "09497751-5456-471e-9a00-f92c12574a99", "producer_name": "testaccount1", "producer_socket_id": "wXI6aBPYOlvhUf1bAAAX"}]
 LOG Closing consumer: 1709d577-8021-4f23-acb3-43779763d85c

```

But I can’t hear any audio playing.

Docker file:

```auto
FROM node:16

WORKDIR /app
# Install DEB dependencies and others.
RUN apt-get update \
	&& apt-get install -y net-tools build-essential python3 python3-pip valgrind
COPY package-lock.json .
COPY package.json .
COPY firebase.json .

RUN npm install

COPY src src
COPY ssl ssl

EXPOSE 3016
EXPOSE 10000-10100

RUN npm i -g nodemon

CMD npm start

```

Config.js:

```auto
const os = require("os");
// const ifaces = os.networkInterfaces();

function getListenIps() {
  const listenIps = [];
  if (typeof window === "undefined") {
    const os = require("os");
    const networkInterfaces = os.networkInterfaces();
    const ips = [];
    if (networkInterfaces) {
      for (const [key, addresses] of Object.entries(networkInterfaces)) {
        addresses.forEach((address) => {
          if (address.family === "IPv4") {
            listenIps.push({ ip: address.address, announcedIp: null });
          } else if (address.family === "IPv6" && address.address[0] !== "f") {
            /* ignore link-local and other special ipv6 addresses.
             * https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml
             */
            listenIps.push({ ip: address.address, announcedIp: null });
          }
        });
      }
    }
  }
  if (listenIps.length === 0) {
    listenIps.push({ ip: "127.0.0.1", announcedIp: null });
  }
  // console.log(listenIps);
  return listenIps;
}

module.exports = {
  // listenIp: "192.168.1.12",
  listenPort: 3016,
  sslCrt: "../ssl/cert.pem",
  sslKey: "../ssl/key.pem",

  mediasoup: {
    // Worker settings
    numWorkers: Object.keys(os.cpus()).length,
    worker: {
      rtcMinPort: 10000,
      rtcMaxPort: 10100,
      logLevel: "warn",
      logTags: [
        "info",
        "ice",
        "dtls",
        "rtp",
        "srtp",
        "rtcp",
        // 'rtx',
        // 'bwe',
        // 'score',
        // 'simulcast',
        // 'svc'
      ],
    },
    // Router settings
    router: {
      mediaCodecs: [
        {
          kind: "audio",
          mimeType: "audio/opus",
          clockRate: 48000,
          channels: 2,
        },
        {
          kind: "video",
          mimeType: "video/VP8",
          clockRate: 90000,
          parameters: {
            "x-google-start-bitrate": 1000,
          },
        },
      ],
    },
    // WebRtcTransport settings
    webRtcTransport: {
      listenIps: getListenIps(),
      maxIncomingBitrate: 1500000,
      initialAvailableOutgoingBitrate: 1000000,
    },
  },
};

```

Here is Docker run command:

```auto
docker run -d -p 3016:3016 -p 10000-10100:10000-10100/tcp -p 10000-10100:10000-10100/udp -it walkie-talkie-rn-server

```

Thank you.  
Vu.

---

<div class="post-metadata">

**Author:** ![zaidiqbal](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/zaidiqbal/32/1498_2.png) [@zaidiqbal](https://mediasoup.discourse.group/u/zaidiqbal)\
**Post date:** [December 27, 2022, 7:47am UTC](https://mediasoup.discourse.group/t/no-audio-when-running-on-docker/4787/2 "2022-12-27T07:47:02Z")

</div>

You are probably missing something in configurations. We have to use proper server public ip in “announcedIp” normally on server and I think this should be the case for docker as well, haven’t tried. Apart from that you must have all the tcp/udp ports range enabled, you provided to mediasoup, on your server. Go to chrome://webrtc-internals and inspect your peer connections with the server, that will tell you many things. Below topic have some similar issue with docker and there are many others:

> [@Docker setup with listenIps](https://mediasoup.discourse.group/t/docker-setup-with-listenips/2557):
>
> Hi All, I’m having some issue receiving AV whilst producing. This is failing due to the fact I’m not passing correct listening ip. My nodejs server is in a docker container running on my local machine. I have passed in the docker container 172.18.x.x address, have also tried my private ipaddress, though they connects but unable to produce. It keeps failing in the producerTransport event. By the way, i’m using the documentation @ibc slight_smile and have made quite a lot of progress already.…

---

<div class="post-metadata">

**Author:** ![MinhVuAlinco](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/minhvualinco/32/1875_2.png) [@MinhVuAlinco](https://mediasoup.discourse.group/u/MinhVuAlinco)\
**Post date:** [December 28, 2022, 4:53am UTC](https://mediasoup.discourse.group/t/no-audio-when-running-on-docker/4787/3 "2022-12-28T04:53:25Z")

</div>

Hi, I dev only on ReactNative(android), how can I check webRTC connect?  
-Docker in my pc, I change announcedIp with public IP.  
-I deploy docker image to aws ecs fargate.  
Nothing change in both case.  
Any guide for this. Many thanks.  
Vu

---

<div class="post-metadata">

**Author:** ![zaidiqbal](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/zaidiqbal/32/1498_2.png) [@zaidiqbal](https://mediasoup.discourse.group/u/zaidiqbal)\
**Post date:** [December 28, 2022, 6:55am UTC](https://mediasoup.discourse.group/t/no-audio-when-running-on-docker/4787/4 "2022-12-28T06:55:39Z")

</div>

chrome://webrtc-internals will not be possible on mobile, you can print the ice candidates received from server in console to see what you are getting, you will be able to verify the missing thing. Do make sure to open the relevant tcp/udp port range on server which you are providing to mediasoup otherwise things will not work. I haven’t used docker, will not be able to help with the docker config, but I have found plenty of topic on this platform related to docker, have you checked them?

---

<div class="post-metadata">

**Author:** ![MinhVuAlinco](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/minhvualinco/32/1875_2.png) [@MinhVuAlinco](https://mediasoup.discourse.group/u/MinhVuAlinco)\
**Post date:** [December 28, 2022, 7:10am UTC](https://mediasoup.discourse.group/t/no-audio-when-running-on-docker/4787/5 "2022-12-28T07:10:17Z")

</div>

Thank you,  
I have add { ip: “0.0.0.0”, announcedIp: “192.168.1.14” } to listenIps. It already work in my pc. (192.168.1.14 is local ip of my network).  
I’m trying to find the public ip of ecs fargate instance to reaplace announcedIp.  
I have read and tried the ways on the discussion group but it didn’t work for me.  
Any way, thank you for your help.

---

<div class="post-metadata">

**Author:** ![zaidiqbal](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/zaidiqbal/32/1498_2.png) [@zaidiqbal](https://mediasoup.discourse.group/u/zaidiqbal)\
**Post date:** [December 28, 2022, 7:43am UTC](https://mediasoup.discourse.group/t/no-audio-when-running-on-docker/4787/6 "2022-12-28T07:43:26Z")

</div>

Ok double check the ports on server, on local ports cause no issue.

---

<div class="post-metadata">

**Author:** ![MinhVuAlinco](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/minhvualinco/32/1875_2.png) [@MinhVuAlinco](https://mediasoup.discourse.group/u/MinhVuAlinco)\
**Post date:** [December 29, 2022, 8:02am UTC](https://mediasoup.discourse.group/t/no-audio-when-running-on-docker/4787/7 "2022-12-29T08:02:00Z")

</div>

yeah, I changed publicIpv4Address of fargate ecs to announcedIp. Great work :))

---

<div class="post-metadata">

**Author:** ![zaidiqbal](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/zaidiqbal/32/1498_2.png) [@zaidiqbal](https://mediasoup.discourse.group/u/zaidiqbal)\
**Post date:** [December 29, 2022, 10:42am UTC](https://mediasoup.discourse.group/t/no-audio-when-running-on-docker/4787/8 "2022-12-29T10:42:11Z")

</div>

Great 👍
