【问题标题】:Docker_Error:-"socket.gaierror: [Errno -3] Temporary failure in name resolution" error comes while run celery on docker imageDocker_Error:-"socket.gaierror: [Errno -3] Temporary failure in name resolution" 在 docker 镜像上运行 celery 时出现错误
【发布时间】:2019-03-08 01:22:52
【问题描述】:

Docker-compose.yml

version: "3"
services:
  web:
    # replace username/repo:tag with your name and image details
    image: sunilsuthar/sim
    deploy:
      replicas: 5
      resources:
        limits:
          cpus: "0.1"
          memory: 50M
      restart_policy:
        condition: on-failure
    ports:
      - "4004:80"
    networks:
      - webnet
  rabbit:
    hostname: rabbit
    image: sunilsuthar/query_with_rabbitmq
    environment:
      - RABBITMQ_DEFAULT_USER=rvihzpae
      - RABBITMQ_DEFAULT_PASS=Z0AWdEAbJpjvy1btDRYqTq2lDoJcXHv7
    links:
      - rabbitmq  
    ports:
      - "15672:15672"
      - "5672:5672"
    tty: true
  celery:
    image: sunilsuthar/query_with_rabbitmq
    command: celery worker -l info -A app.celery 
    user: nobody
    volumes:
      - '.:/app'    
networks:
  webnet:

【问题讨论】:

    标签: docker-compose


    【解决方案1】:

    检查您的 docker 容器是否在正确的网络上,以及您是否可以使用 rabbitmq ping 服务器。在我的情况下,防火墙设置已重置,并且无法从容器内访问本地网络。重启 docker daemon 解决了这个问题。

    【讨论】:

      猜你喜欢
      • 2020-11-11
      • 1970-01-01
      • 2020-05-08
      • 2023-01-27
      • 2019-10-16
      • 1970-01-01
      • 2022-06-10
      • 2021-05-13
      • 2014-09-05
      相关资源
      最近更新 更多