Token导航 LogoToken导航TokenDH.com
前端设计执行命令github未标认证来源可访问许可证需确认审计异常

docker-containersDocker containers 部署

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

190

周安装

8

GitHub Stars

11

下载量

67
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:docker-containers(Docker containers 部署)
来源仓库:https://github.com/lobbi-docs/claude
仓库路径:skills/docker-containers
安装命令:
npx skills add https://github.com/lobbi-docs/claude --skill docker-containers
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lobbi-docs/claude --skill docker-containers

简介

为 .NET 多容器应用生成标准化 Docker 配置与部署方案。

  • 支持多阶段构建、分层缓存优化及跨服务依赖编排,覆盖 Web API 与数据库场景。
  • 基于项目结构自动识别服务边界并生成 docker-compose 文件,集成健康检查机制。
  • 需确认 .NET SDK 版本、目标运行时及网络拓扑,生产环境应启用非 root 用户运行。
  • docker-containers 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Multi-Container.NET Applications

Multi-Stage Dockerfile (.NET 10)

# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src

# Copy solution and project files for layer caching
COPY *.sln .
COPY Directory.Build.props Directory.Packages.props ./
COPY src/MyApp.Web/MyApp.Web.csproj src/MyApp.Web/
COPY src/MyApp.Api/MyApp.Api.csproj src/MyApp.Api/
COPY src/MyApp.Domain/MyApp.Domain.csproj src/MyApp.Domain/
COPY src/MyApp.Infrastructure/MyApp.Infrastructure.csproj src/MyApp.Infrastructure/
RUN dotnet restore

# Copy source and publish
COPY . .
RUN dotnet publish src/MyApp.Web/MyApp.Web.csproj -c Release -o /app/publish --no-restore

# Runtime stage (minimal image)
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080
ENV DOTNET_RUNNING_IN_CONTAINER=true

# Non-root user for security
USER $APP_UID

COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "MyApp.Web.dll"]

Docker Compose (Development)

services:
  # Blazor Web App
  webapp:
    build:
      context: .
      dockerfile: src/MyApp.Web/Dockerfile
    ports:
      - "5000:8080"
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ConnectionStrings__Default=Host=postgres;Database=myapp;Username=postgres;Password=devpass
      - ConnectionStrings__Redis=redis:6379
      - RabbitMQ__Host=rabbitmq
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_started
    volumes:
      - ~/.aspnet/https:/https:ro  # Dev HTTPS certs
    networks:
      - backend

  # API Service
  api:
    build:
      context: .
      dockerfile: src/MyApp.Api/Dockerfile
    ports:
      - "5001:8080"
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ConnectionStrings__Default=Host=postgres;Database=myapp;Username=postgres;Password=devpass
      - ConnectionStrings__Redis=redis:6379
    depends_on:
      postgres:
        condition: service_healthy
    networks:
      - backend

  # Worker Service
  worker:
    build:
      context: .
      dockerfile: src/MyApp.Worker/Dockerfile
    environment:
      - ConnectionStrings__Default=Host=postgres;Database=myapp;Username=postgres;Password=devpass
      - RabbitMQ__Host=rabbitmq
    depends_on:
      postgres:
        condition: service_healthy
      rabbitmq:
        condition: service_healthy
    networks:
      - backend

  # PostgreSQL
  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: myapp
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: devpass
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5
    networks:
      - backend

  # Redis
  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    networks:
      - backend

  # RabbitMQ
  rabbitmq:
    image: rabbitmq:3-management-alpine
    ports:
      - "5672:5672"   # AMQP
      - "15672:15672" # Management UI
    environment:
      RABBITMQ_DEFAULT_USER: guest
      RABBITMQ_DEFAULT_PASS: guest
    healthcheck:
      test: ["CMD", "rabbitmq-diagnostics", "check_port_connectivity"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - backend

  # SQL Server (alternative to PostgreSQL)
  # sqlserver:
  #   image: mcr.microsoft.com/mssql/server:2022-latest
  #   environment:
  #     ACCEPT_EULA: "Y"
  #     MSSQL_SA_PASSWORD: "YourStrong!Password"
  #   ports:
  #     - "1433:1433"

volumes:
  postgres_data:
  redis_data:

networks:
  backend:
    driver: bridge

Integration Event Bus (RabbitMQ)

// Integration event (crosses service boundaries)
public sealed record OrderPaymentSucceededIntegrationEvent(
    int OrderId, DateTime PaymentDate) : IntegrationEvent;

// Event bus interface
public interface IEventBus
{
    Task PublishAsync<T>(T @event, CancellationToken ct = default) where T : IntegrationEvent;
    void Subscribe<T, THandler>() where T : IntegrationEvent where THandler : IIntegrationEventHandler<T>;
}

// Integration event handler
public sealed class OrderPaymentSucceededHandler(
    IOrderRepository orderRepo,
    ILogger<OrderPaymentSucceededHandler> logger)
    : IIntegrationEventHandler<OrderPaymentSucceededIntegrationEvent>
{
    public async Task Handle(OrderPaymentSucceededIntegrationEvent @event, CancellationToken ct)
    {
        logger.LogInformation("Payment succeeded for order {OrderId}", @event.OrderId);
        var order = await orderRepo.GetAsync(@event.OrderId, ct);
        order?.SetPaidStatus();
        await orderRepo.UnitOfWork.SaveEntitiesAsync(ct);
    }
}

API Gateway Pattern

// Using YARP (Yet Another Reverse Proxy) - Microsoft's recommended gateway
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddReverseProxy()
    .LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"));

var app = builder.Build();
app.MapReverseProxy();
app.Run();
// appsettings.json for YARP
{
  "ReverseProxy": {
    "Routes": {
      "catalog-route": {
        "ClusterId": "catalog-cluster",
        "Match": { "Path": "/api/catalog/{**catch-all}" }
      },
      "ordering-route": {
        "ClusterId": "ordering-cluster",
        "Match": { "Path": "/api/orders/{**catch-all}" }
      }
    },
    "Clusters": {
      "catalog-cluster": {
        "Destinations": {
          "destination1": { "Address": "http://catalog-api:8080/" }
        }
      },
      "ordering-cluster": {
        "Destinations": {
          "destination1": { "Address": "http://ordering-api:8080/" }
        }
      }
    }
  }
}

.NET Docker Images

ImageUse forSize
mcr.microsoft.com/dotnet/sdk:10.0Build stage only~800MB
mcr.microsoft.com/dotnet/aspnet:10.0Web apps, APIs~220MB
mcr.microsoft.com/dotnet/runtime:10.0Console/worker apps~190MB
mcr.microsoft.com/dotnet/runtime-deps:10.0Self-contained AOT~110MB

Best Practices

  • Use multi-stage builds (build with SDK, run with aspnet/runtime)
  • Copy.csproj files first for Docker layer caching on restore
  • Use health checks in docker-compose for dependency ordering
  • Run as non-root user in production containers
  • Use .dockerignore to exclude bin/, obj/,.git/
  • Pin image versions (never use :latest alone in production)
  • Use named volumes for persistent data

Reference

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.41%
按下载量换算23

Claude

33.79%
按下载量换算23

Cursor

19.16%
按下载量换算13

Gemini CLI

10%
按下载量换算7

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

未通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/lobbi-docs/claude --skill docker-containers 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills