devcontainer-management
GitHub指导识别、管理和运行 NetAlertX 开发容器内的命令。用于在容器中执行测试、设置脚本或排查容器相关问题,确保正确找到并操作目标容器。
Trigger Scenarios
Install
npx skills add netalertx/NetAlertX --skill devcontainer-management -g -y
SKILL.md
Frontmatter
{
"name": "devcontainer-management",
"description": "Guide for identifying, managing, and running commands within the NetAlertX development container. Use this when asked to run commands, testing, setup scripts, or troubleshoot container issues."
}
Devcontainer Management
When starting a session or performing tasks requiring the runtime environment, you must identify and use the active development container.
Finding the Container
Run docker ps to list running containers. Look for an image name containing vsc-netalertx or similar.
docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}" | grep netalertx
- If no container is found: Inform the user. You cannot run integration tests or backend logic without it.
- If multiple containers are found: Ask the user to clarify which one to use (e.g., provide the Container ID).
Running Commands in the Container
Prefix commands with docker exec <CONTAINER_ID> to run them inside the environment. Use the scripts in /services/ to control backend and other processes.
docker exec <CONTAINER_ID> bash /workspaces/NetAlertX/.devcontainer/scripts/setup.sh
Note: This script wipes /tmp ramdisks, ensures /data, /data/config, /data/db exist, and restarts services (python server, cron, php-fpm, nginx) by symlinking and running /entrypoint.sh (install/production-filesystem/entrypoint.d/). By default it does not delete existing database or config content - entrypoint.d/25-first-run-db.sh and 20-first-run-config.sh only wipe them when ALWAYS_FRESH_INSTALL=true is set in the environment (default: unset/false, so content is preserved).
Version History
-
a686a01
Current 2026-09-03 06:46
优化 setup.sh 脚本说明,明确默认保留数据库和配置内容,仅当设置特定环境变量时才清除,增强了文档的鲁棒性和准确性。
- 8aec57b 2026-07-24 22:13


