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
379 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,550 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
763 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,550 points
197 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,820 points
1,365 views
+2 votes
1 answer

Error: You might need to start Docker for Windows. How do i start the daemon?

Hi, If you are running containers with Docker, ...READ MORE

answered May 19 in DevOps & Agile by MD
• 57,560 points
2,770 views
+2 votes
1 answer
+2 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
• 57,660 points
784 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,550 points
204 views
0 votes
1 answer