How to fix the misconfiguration of DNS for python app?

0 votes

I have containerized my python application. I need to set my own DNS server address to make pip work properly.

I want to change the DNS settings of the Docker daemon. Can anyone help me with this?

Thanks. 

Dec 12, 2018 in DevOps & Agile by Shubham
• 1,000 points
94 views

1 answer to this question.

0 votes

Based on what you have mentioned in your query, I assume that you have written a Dockerfile for your python application and have created a container as well.

Now here is what what you can try to set the DNS address for your python application.

Try changing the DNS settings of the Docker daemon. You can edit (or create) the configuration file at /etc/docker/daemon.json with the dns key, as following:

{
  "dns": ["your_dns_address", "8.8.8.8"]
}

In the above command, the first element of the list is the address of your DNS server. The second item is the Google’s DNS which can be used when the first one is not available.

Before moving ahead, save daemon.json and restart the docker service by typing below commands::

sudo service docker restart

Once you think the DNS problem is fixed, retry to run the build command.

I hope that the above information will resolve your query.

answered Dec 12, 2018 by Damon Salvatore
• 5,510 points

Related Questions In DevOps & Agile

+5 votes
2 answers

How to program and get the Digital Ocean ID of the current Droplet from within the Droplet?

You can run curl http://169.254.169.254/metadata/v1/id within the ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by Atul
• 10,240 points
233 views
0 votes
1 answer

How to a run deployed app in Docker for Windows?

To deploy an ASP.NET web application to ...READ MORE

answered Aug 29, 2018 in DevOps & Agile by Tyrion anex
• 8,270 points
119 views
0 votes
2 answers

How to customize the RAM allocation on Docker for Windows?

Try this: docker update --cpu-shares 5120 -m 3000M ...READ MORE

answered Dec 6, 2018 in DevOps & Agile by Maverick
• 10,040 points
88 views
+2 votes
2 answers

how to set different provisioning profiles for different targets using Xcode Build

For multiple targets, each task has to ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by ajs3033
• 7,280 points

edited Oct 16, 2018 by Kalgi 625 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,520 points
154 views
+4 votes
1 answer

How to orchestrate a multi-tier web-app over swarm cluster ?

I understand from your query that you ...READ MORE

answered Dec 11, 2018 in DevOps & Agile by Damon Salvatore
• 5,510 points
41 views
0 votes
1 answer