包含Docker的日志仅显示“附加到"没有别的 [英] Docker-compose logs are only showing "Attaching to" and nothing else

查看:74
本文介绍了包含Docker的日志仅显示“附加到"没有别的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行" docker-compose up -d --force-recreate"之后,+ service_name 通过python subprocess.call(),然后我想使用简单的" docker-compose日志从docker-compose命令打印出日志"+ service_name .但是,日志将仅随机具有附加到"日志.在其中,而不是完整打印日志.我正在对容器进行数据库更改,首先更改DDL,然后更改DML.事实证明,该容器已成功旋转,并且进行了更改,并且当我去运行DML阶段时,该容器已成功升级,并且日志将打印出来,因此日志似乎停留在附加到"目录中.即使容器仍在继续完成.

After running "docker-compose up -d --force-recreate " + service_name via a python subprocess.call(), I then afterwards want to print out the logs from the docker-compose command using just a simple "docker-compose logs " + service_name. However, the logs will randomly only have "Attaching to" in them, rather than the full printout of logs. I am doing database changes to the containers, with first DDL changes and then DML changes. It turns out that the container is successfully being spun up and my changes made, and when I go to run the DML stage the container successfully upgrades and logs will print out, so it seems that the logs are getting stuck at "Attaching to" even though the container is continuing on to complete.

为什么docker-compose日志仅显示附加到"?

Why would docker-compose logs only be showing "Attaching to"?

docker-compose文件的一部分:

Part of docker-compose file:

services:
  #
  # Components
  # ----------
  #
  agile:
    image: image
    ports:
    - 10031:8080
    environment:
    - JAVA_OPTS=-Xmx768m -Xss512k
    - ACTIVE_RELEASE_ID=${ACTIVE_RELEASE_ID}
    - CACHE_HOST=localdocker
    - CODE_DROP_ID=${CODE_DROP_ID}
    - ENVIRONMENT_TYPE=side
    - EUREKA_HOST=localdocker
    - KV_STORE_ADDRESS=localdocker:8500
    - KV_STORE_HOST=localdocker
    - KV_STORE_PORT=8500
    - KV_STORE_TYPE=remote
    - MESSAGING_HOST=localdocker
    - SEARCH_HOST=localdocker
    - SPRING_CLOUD_CONSUL_CONFIG_ENABLED=true
    - VIRTUAL_HOST=localdocker
    extra_hosts:
    - localdocker:${LOCALDOCKER_HOSTNAME}
    logging:
      driver: fluentd
      options:
        tag: docker
        env: NodeHostName,NodeID,Service,ServiceLabels,Task,TaskSlot,TaskID,TZ
        fluentd-address: ${LOCALDOCKER_HOSTNAME}:24224
        fluentd-async-connect: "true"

这是大约40个正在构建的组件之一.我正在使用Ansible来异步运行命令.

That is one of roughly 40 components that are being built. I am using Ansible to do asynchronous running of my commands.

推荐答案

它是从构建的映像中附加到容器(该名称在撰写文件中给出)的附件,并已将docker-file扔了出去.容器和图像出现错误,原因是在UP中容器和图像的名称与细节不匹配...

It is Attaching to the container(which name of that is give in the compose file) from the image which is built threw the docker-file. there is a error with container and images by the way of mismatched the details as names of containers and images while in UP ...

这篇关于包含Docker的日志仅显示“附加到"没有别的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆