fluentd-docker-image icon indicating copy to clipboard operation
fluentd-docker-image copied to clipboard

Cannot log in when using loopback address alias

Open chatii opened this issue 4 years ago • 0 comments

  • OS: macOS Catalina 10.15.6
  • docker desktop: 2.3.0.4
  • docker Engine: 19.03.12
  • docker Compose: 1.26.2

I'm using Docker with a local loopback address. First, we run the following on the host machine.

DOCKER_HOST_ALIAS_IP="127.100.200.199"
sudo ifconfig lo0 alias ${DOCKER_HOST_ALIAS_IP} up

The docker-compose.yml was prepared as follows (excerpt)

version: '3.8'

x-logging:
  &default-logging
  driver: "fluentd"
  options:
    fluentd-address: fluentd:24224
    fluentd-async-connect: "true"
    tag: "log.{{.Name}}"

services:
  fluentd:
    image: fluent/fluentd:v1.11-1
    ports:
      - "127.20.9.14:24224:24224"

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.9.1
    environment:
      - "discovery.type=single-node"
    expose:
      - "9200"
    ports:
      - "127.20.9.14:9200:9200"
    depends_on:
      - fluentd

  kibana:
    image: docker.elastic.co/kibana/kibana-oss:7.9.1
    links:
      - "elasticsearch"
    ports:
      - "127.20.9.14:5601:5601"
    depends_on:
      - fluentd

  nginx:
    image: nginx:alpine
    volumes:
      - ./.Docker/php-fpm/php.ini:/usr/local/etc/php/php.ini
      - ./:/var/www:cached
    expose:
      - "9000"
    ports:
      - "127.20.9.14:80:80"
    logging: *default-logging
    depends_on:
      - fluentd

elasticsearch and kibana seem to be working correctly. However, the log of php-fpm doesn't seem to be passed to fluentd.

I tried it without using an alias IP (no IP address in the ports) and everything worked fine. So I am wondering if the problem is when using an alias IP. Can this be resolved?


Modified docker-compose.yml sample. Change to one that works as it is. (and sample repo: https://github.com/chatii/fluentd_docker_test)

chatii avatar Sep 12 '20 05:09 chatii