{"id":37211015,"url":"https://github.com/seakee/dockmon","last_synced_at":"2026-01-15T00:01:57.948Z","repository":{"id":247902405,"uuid":"820719640","full_name":"seakee/dockmon","owner":"seakee","description":"Docklog 是一个用 Go 编写的日志收集器，可以从 Docker 容器中收集日志并存储到数据库中。它支持解析结构化和非结构化日志，监控 Docker 事件以动态收集新启动容器的日志。","archived":false,"fork":false,"pushed_at":"2025-04-29T10:31:22.000Z","size":86,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-29T11:33:21.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seakee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-27T03:43:09.000Z","updated_at":"2025-04-29T10:31:25.000Z","dependencies_parsed_at":"2025-04-29T11:39:00.991Z","dependency_job_id":null,"html_url":"https://github.com/seakee/dockmon","commit_stats":null,"previous_names":["seakee/dockmon"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/seakee/dockmon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seakee%2Fdockmon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seakee%2Fdockmon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seakee%2Fdockmon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seakee%2Fdockmon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seakee","download_url":"https://codeload.github.com/seakee/dockmon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seakee%2Fdockmon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-15T00:01:57.893Z","updated_at":"2026-01-15T00:01:57.941Z","avatar_url":"https://github.com/seakee.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dockmon\n\n## 项目介绍\n\nDockmon 是一个用 Go 编写的 Docker容器监视器，可以从 Docker 容器中收集日志并存储到 MySQL 数据库中。它支持解析结构化和非结构化日志，监控 Docker 事件以动态收集新启动容器的日志。\n\n## 功能特性\n\n- 收集指定容器的日志\n- 支持结构化和非结构化日志解析\n- 监控 Docker 事件，动态收集新启动容器的日志\n- 日志存储到 MySQL 数据库，包含容器 ID 和名称\n\n## 环境要求\n\n- Go 1.22 或更高版本\n- Docker\n- MySQL\n- Redis\n\n## 安装与使用\n\n### 本地运行\n\n1. 克隆仓库\n\n    ```sh\n    git clone https://github.com/seakee/dockmon.git\n    cd dockmon\n    ```\n\n2. 修改配置文件\n   ```sh\n   cp bin/configs/local.json.default bin/configs/local.json\n   ```\n   修改 `bin/configs/local.json` 文件redis、mysql 等配置.`system.jwt_secret`参数不能为空，建议至少 32 位以上随机字符。\n\n3. 初始化数据库\n\n   将 `bin/data/sql` 目录下的 sql 文件导入到 MySQL 数据库\n \n4. 编译项目\n\n    ```sh\n    make build\n    ```\n   或者\n   ```sh\n   chmod +x ./scripts/dockmon.sh\n   ./scripts/dockmon.sh build\n   ```\n5. 运行程序\n\n    ```sh\n    make run\n    ```\n   或者\n   ```sh\n   ./scripts/dockmon.sh run\n   ```\n### Docker 运行\n\n#### 构建 Docker 镜像\n\n1. 构建 Docker 镜像\n\n    ```sh\n    make docker-build\n    ```\n   或者\n   ```sh\n   chmod +x ./scripts/dockmon.sh\n   ./scripts/dockmon.sh docker-build\n   ```\n#### 运行 Docker 容器\n1. 运行 Docker 容器\n\n    ```sh\n    make docker-run \n    ```\n   或者\n   ```sh\n   ./scripts/dockmon.sh docker-run\n   ```\n   或者手动运行 Docker 容器并指定环境变量：\n\n    ```sh\n    docker run -d --name $(PROJECT_NAME) \\\n\t\t-p 8085:8080 \\\n\t\t-it \\\n\t\t-v /var/run/docker.sock:/var/run/docker.sock \\\n\t\t-v $(CONFIG_DIR):/bin/configs \\\n\t\t-v /bin/docker:/bin/docker \\\n\t\t-e APP_NAME=$(PROJECT_NAME) \\\n\t\t$(IMAGE_NAME)\n   ```\n\n## 许可证\n本项目采用 MIT 许可证。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseakee%2Fdockmon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseakee%2Fdockmon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseakee%2Fdockmon/lists"}