首页 > 解决方案 > 如何在 IntelliJ 中显示 docker 容器的运行状况?

问题描述

我有一个docker-compose.yml文件,我正在使用 IntellJ 2019.2运行该服务,它工作正常。

我想通过 IntelliJ 查看我的容器的健康状态(启动、健康 .etc)。
但是,我发现的唯一方法是right-click on the container > inspect > search the state in the json,这不是很方便。

有谁知道另一种轻松显示容器健康状态的方法?

检查中的json

[...]
"State": {
        "Status": "running",
        "Health": {
          "Status": "healthy", // that's what I want
[...]

码头工人撰写文件

version: '3.4'

services:

  application:
    image: com.my.company/image
    depends_on: 
      - database
    build: ./build
    ports:
      - "8080:8080"
    networks:
      - app_network
    healthcheck:
      test: ["CMD", "curl", "-sSf", "http://localhost:8080/app"]
      start_period: 30s

标签: dockerintellij-ideadocker-composehealth-monitoring

解决方案


有一个显示健康状态的功能请求: https ://youtrack.jetbrains.com/issue/IDEA-214513


推荐阅读