代码之家  ›  专栏  ›  技术社区  ›  tweetysat

运行Bind9-Logs文件的Docker容器仍为空

  •  0
  • tweetysat  · 技术社区  · 6 年前

    我有个码头集装箱在运行 Bind9

    在容器内 named 正在与 bind 用户

    bind         1     0  0 19:23 ?        00:00:00 /usr/sbin/named -u bind -g
    

    在我的 named.conf.local

    channel queries_log {
        file "/var/log/bind/queries.log";
        print-time yes;
        print-category yes;
        print-severity yes;
        severity info;
    };
    
    category queries { queries_log; };
    

    -rw-r--r-- 1 bind bind 0 Nov 14 19:23 queries.log
    

    另一方面,使用 docker logs ...

    14-Nov-2018 19:26:10.463 client @0x7f179c10ece0 ...
    

    不使用Docker也可以使用相同的配置。

    我的 docker-compose.yml

    version: '3.6'
    services:
        bind9:
            build: .
            image: bind9:1.9.11.3
            container_name: bind9
            ports:
              - "53:53/udp"
              - "53:53/tcp"
            volumes:
                - ./config/named.conf.options:/etc/bind/named.conf.options
                - ./config/named.conf.local:/etc/bind/named.conf.local
    

    我的 Dockerfile

    FROM ubuntu:18.04
    ENV BIND_USER=bind \
        BIND_VERSION=1:9.11.3
    RUN apt-get update -qq \
    && DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends install -y \
     bind9=${BIND_VERSION}* \
     bind9-host=${BIND_VERSION}* \
     dnsutils \
    &&  rm -rf /var/lib/apt/lists/*
    COPY entrypoint.sh /sbin/entrypoint.sh
    RUN chmod 755 /sbin/entrypoint.sh
    ENTRYPOINT ["/sbin/entrypoint.sh"]
    CMD ["/usr/sbin/named"]
    
    0 回复  |  直到 6 年前
        1
  •  0
  •   우병열    4 年前
       -f
           Run the server in the foreground (i.e. do not daemonize).
    
       -g
           Run the server in the foreground and force all logging to stderr.
    

    推荐文章