Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

218
Visualizações
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
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

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.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda