You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if you might have some examples of how to use this library inside Docker/Kubernetes environment? I running into issues when trying to set it up in such an environment.
I tried running the container with such parameters:
index.js
constmdnsService=require('multicast-dns')constport=process.env.PORT||53constserver=mdnsService({
port
})server.on('query',function(query){console.log('DNS Query:',query.questions)})console.log(`Box up & running on port ${port}.`);['SIGHUP','SIGINT','SIGQUIT','SIGILL','SIGTRAP','SIGABRT','SIGBUS','SIGFPE','SIGUSR1','SIGSEGV','SIGUSR2','SIGTERM'].forEach(function(sig){process.on(sig,function(){console.log('Box is shutting down.')server.destroy()})})
Dockerfile
FROM node:current-alpine3.13
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# update and install dependencyRUN apk update && apk upgrade
RUN apk add git
# copy the app, note .dockerignoreCOPY package*.json /usr/src/app/
RUN npm install
COPY . /usr/src/app/
CMD [ "node", "index.js" ]
The above command works fine when I run this app via node index.js and I can see the log statement for the DNS query. But when I run it in docker, it looks like my diq requests are not coming through.
Thanks in advance for your help!
The text was updated successfully, but these errors were encountered:
Hi,
I'm wondering if you might have some examples of how to use this library inside Docker/Kubernetes environment? I running into issues when trying to set it up in such an environment.
I tried running the container with such parameters:
index.js
Dockerfile
Commands to build & run the container:
docker build -t multicast-dns . docker run -it -e PORT=53 -p 53:53/udp -p 53:53/tcp multicast-dns
Command to test the app:
The above command works fine when I run this app via
node index.js
and I can see the log statement for the DNS query. But when I run it in docker, it looks like my diq requests are not coming through.Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: