Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
Why is docker looking in /simple for python packages?

I've been trying to get django to run via uwsgi in a docker container.

I had django running in docker, with its built in web server, but now that I've modified the requirements.txt to include uwsgi, I keep getting the following error message:

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/uwsgi/

So it seems like the url docker is using for pip packages is /simple, but how did that change? When I first created the container django and psycopg got downloaded fine.

I tried specifying the full URL of the uwsgi package, but that didn't work either.

docker-compose.yaml:

version: '3'
services:
  db:
    image: postgres
  web:
    dns: 8.8.8.8
    build: .
    command: uwsgi --http :8000 --module destExp.wsgi
    volumes:
      - .:/code
    ports:
      - "8000:8000"
    depends_on:
      - db

Dockerfile:

FROM python:3.5
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code/
CMD uwsgi --http :8000 --module destExp.wsgi
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

That error is due pip is unable to reach to the mirror host. Part /simple/uwsgi is being used as pip url path.

DNS line in Compose is ignored for v3 specification if you are deploying to Swarm, as stated in the doc. Here is a workaround to make pip use different DNS momentarily, simply update your pip line in Dockerfile to following:

RUN echo nameserver 8.8.8.8 > /etc/resolv.conf && pip install -r requirements.txt

Hope that helps. As a permanent solution, you should investigate how to make your orchestration use the custom DNS or troubleshoot the current DNS from the container for your case.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!