如何从Docker撰写文件中的容器获取journalctl日志

时间:2018-08-07 10:58:34

标签: docker docker-compose dockerfile

我有一个docker compose文件和3个包含此文件的容器。在其中之一  容器,应用程序(sampleappservice)将日志发送到journalctl,我想捕获它。如何获取它? 这是我的撰写文件: **

version: '3'
services:                
    simulatorservice:
        image: "data-simulator:latest"
        container_name: data-simulator
        build: 
          context: ./
          dockerfile: ./Dockerfile-simulator
        ports : 
        - "55501:55501"
        volumes:
        - ./data:/opt/apps/DataSimulator/data
    mosquittoservice:
        image: "databus:latest"
        container_name: databus
        build: 
          context: ./
          dockerfile: ./Dockerfile-databus        
        ports : 
        - "1883:1883"
    sampleappservice:##I need to get this container journalctl log.
        image: "sampleapp:latest"
        container_name: sampleapp
        build: 
          context: ./
          dockerfile: ./Dockerfile-sampleapp

**

0 个答案:

没有答案