linux-docker
Docker/Compose: Dockerfile, networking, volumes, container lifecycle, registry, security hardening
What this skill does
# linux-docker
## Purpose
This skill allows the AI to handle Docker and Docker Compose operations on Linux, focusing on Dockerfile creation, container management, networking, volumes, lifecycle events, registry interactions, and security hardening to ensure efficient, secure containerized applications.
## When to Use
Use this skill for tasks involving containerization of applications, such as building images from source code, deploying multi-service apps with Compose, managing network configurations for inter-container communication, or securing containers against vulnerabilities in a Linux environment.
## Key Capabilities
- Build and manage Docker images using Dockerfiles: Specify base images, add layers with COPY/ADD, set ENTRYPOINT/CMD.
- Configure networking: Use bridge, host, or overlay networks with flags like `--network bridge`.
- Handle volumes: Mount host directories or named volumes with `-v /host/path:/container/path`.
- Manage container lifecycle: Start, stop, restart containers using commands that handle signals like SIGTERM.
- Interact with registries: Push/pull images to/from repositories like Docker Hub, with authentication.
- Apply security hardening: Use options like `--security-opt no-new-privileges` to limit capabilities, and scan images with tools like Trivy.
## Usage Patterns
To build an image, read a Dockerfile, then execute `docker build` with appropriate context; for Compose, parse a YAML file and run `docker-compose up`. Always check for required dependencies like Docker daemon running. For networking, specify networks in Compose YAML under the `networks` key. Use environment variables for sensitive data, e.g., inject `$DOCKER_REGISTRY_URL` into container env. For security, always run containers with `--read-only` flag where possible to prevent writes.
## Common Commands/API
- Build an image: `docker build -t myimage:1.0 .` (use `-f path/Dockerfile` for custom file).
- Run a container: `docker run -d --name mycontainer -p 8080:80 -v /host/data:/app/data myimage:1.0`.
- Manage networks: `docker network create mynet` then `docker run --network mynet myimage`.
- Use volumes: `docker volume create myvolume` and mount with `-v myvolume:/data`.
- Container lifecycle: `docker start mycontainer`, `docker stop mycontainer`, `docker rm -f mycontainer`.
- Registry operations: `docker login -u user -p $DOCKER_PASSWORD registry.example.com`; push with `docker push myimage:1.0`.
- Docker Compose: `docker-compose -f docker-compose.yml up -d`; define services in YAML like:
```
version: '3'
services:
web:
image: nginx
ports:
- "80:80"
```
- API endpoints: Use Docker Engine API, e.g., GET /containers/json to list containers; authenticate with headers including `$DOCKER_API_KEY`.
## Integration Notes
Integrate by ensuring Docker is installed via `apt install docker.io` on Ubuntu. For registry access, set env vars like `export DOCKER_REGISTRY_URL=registry.example.com` and `export DOCKER_API_KEY=yourkey`. When combining with other skills, e.g., in a CI/CD pipeline, use Compose files to orchestrate with tools like Jenkins; reference external configs with `${VAR}` in YAML. For security, always pull from trusted registries and use `--cap-drop ALL` in run commands. If using orchestration tools like Kubernetes, export Compose files with `docker-compose config` for conversion.
## Error Handling
Handle permission errors by prefixing commands with `sudo`, e.g., `sudo docker run ...`; check with `groups` to ensure user is in `docker` group. For image pull failures, verify registry auth with `echo $DOCKER_API_KEY` and retry `docker pull`. Network issues: Use `docker network inspect mynet` to debug; fix with `docker network prune`. Dockerfile build errors: Parse logs for messages like "no such file or directory" and correct paths. Compose errors: Validate YAML with `docker-compose config` before running; common fix for "service not found" is checking indentation. Always use `docker ps -a` to inspect running/faulty containers and `docker logs mycontainer` for output.
## Concrete Usage Examples
1. Build and run a simple Nginx container: First, create a Dockerfile with `FROM nginx:alpine; COPY index.html /usr/share/nginx/html;`. Then, build it: `docker build -t mynginx .`. Run securely: `docker run -d --name webserver -p 8080:80 --read-only mynginx`. Access at localhost:8080.
2. Orchestrate a web app with Compose: Create a docker-compose.yml file:
```
version: '3'
services:
db:
image: postgres
volumes:
- dbdata:/var/lib/postgresql/data
web:
image: mynginx
ports:
- "8080:80"
volumes:
dbdata:
```
Then, start: `docker-compose up -d`. Scale web service: `docker-compose up -d --scale web=3`.
## Graph Relationships
- Connected to: linux cluster (parent).
- Related skills: based on tags ["docker", "containers", "compose", "registry"]; links to skills like container-management or linux-networking for extended operations.
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.