{"id":48582540,"url":"https://github.com/zircote/dockerfile-lsp","last_synced_at":"2026-04-08T17:34:16.823Z","repository":{"id":332175425,"uuid":"1126933817","full_name":"zircote/dockerfile-lsp","owner":"zircote","description":"Claude Code plugin for Dockerfile development with dockerfile-language-server and hadolint","archived":false,"fork":false,"pushed_at":"2026-02-28T01:36:52.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-28T03:43:55.474Z","etag":null,"topics":["claude-code-plugin","code-quality","docker","dockerfile","hadolint","lsp"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","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/zircote.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"zircote"}},"created_at":"2026-01-02T21:04:16.000Z","updated_at":"2026-02-28T01:36:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zircote/dockerfile-lsp","commit_stats":null,"previous_names":["zircote/dockerfile-lsp"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zircote/dockerfile-lsp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Fdockerfile-lsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Fdockerfile-lsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Fdockerfile-lsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Fdockerfile-lsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zircote","download_url":"https://codeload.github.com/zircote/dockerfile-lsp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Fdockerfile-lsp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31567056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["claude-code-plugin","code-quality","docker","dockerfile","hadolint","lsp"],"created_at":"2026-04-08T17:34:15.765Z","updated_at":"2026-04-08T17:34:16.808Z","avatar_url":"https://github.com/zircote.png","language":"Dockerfile","readme":"# dockerfile-lsp\n\n[![Version](https://img.shields.io/badge/version-0.1.0-blue.svg)](CHANGELOG.md)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n[![Claude Plugin](https://img.shields.io/badge/claude-plugin-orange.svg)](https://docs.anthropic.com/en/docs/claude-code/plugins)\n[![Marketplace](https://img.shields.io/badge/marketplace-zircote--lsp-purple.svg)](https://github.com/zircote/lsp-marketplace)\n[![Docker](https://img.shields.io/badge/Docker-2496ED?logo=docker\u0026logoColor=white)](https://www.docker.com/)\n\nA Claude Code plugin providing comprehensive Dockerfile development support through:\n\n- **docker-langserver LSP** integration for IDE-like features\n- **Automated hooks** for linting with hadolint and best practices\n- **Dockerfile tool ecosystem** integration (docker, hadolint)\n\n## Quick Setup\n\n```bash\n# Run the setup command (after installing the plugin)\n/setup\n```\n\nOr manually:\n\n```bash\n# Install docker-langserver (LSP)\nnpm install -g dockerfile-language-server-nodejs\n\n# Install hadolint (linter)\n# macOS (Homebrew)\nbrew install hadolint\n\n# Linux\nwget -qO /usr/local/bin/hadolint https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64\nchmod +x /usr/local/bin/hadolint\n\n# Ensure Docker is installed\ndocker --version\n```\n\n## Features\n\n### LSP Integration\n\nThe plugin configures docker-langserver for Claude Code via `.lsp.json`:\n\n```json\n{\n    \"dockerfile\": {\n        \"command\": \"docker-langserver\",\n        \"args\": [\"--stdio\"],\n        \"extensionToLanguage\": {\n            \"Dockerfile\": \"dockerfile\",\n            \".dockerfile\": \"dockerfile\"\n        },\n        \"transport\": \"stdio\"\n    }\n}\n```\n\n**Capabilities:**\n- Go to definition for base images\n- Hover documentation for instructions\n- Code completion for Dockerfile instructions\n- Real-time diagnostics\n- Validation of instruction syntax\n\n### Automated Hooks\n\nAll hooks run `afterWrite` and are configured in `hooks/hooks.json`.\n\n#### Dockerfile Hooks\n\n| Hook | Trigger | Tool Required | Description |\n|------|---------|---------------|-------------|\n| `hadolint` | `Dockerfile`, `*.dockerfile` | `hadolint` | Best practices and security linting |\n| `docker-build-check` | `Dockerfile`, `*.dockerfile` | `docker` | Syntax validation via Docker |\n| `todo-fixme` | `Dockerfile`, `*.dockerfile` | - | Surface TODO/FIXME/HACK/XXX/BUG comments |\n\n**Hook Features:**\n- Detects security issues (running as root, hardcoded secrets)\n- Enforces best practices (layer caching, multi-stage builds)\n- Validates instruction syntax\n- Checks for deprecated instructions\n- Suggests performance improvements\n\n## Required Tools\n\n### Core\n\n| Tool | Installation | Purpose |\n|------|--------------|---------|\n| `docker-langserver` | `npm install -g dockerfile-language-server-nodejs` | LSP server |\n| `docker` | [docker.com](https://www.docker.com/) | Container runtime \u0026 syntax validation |\n\n### Recommended\n\n| Tool | Installation | Purpose |\n|------|--------------|---------|\n| `hadolint` | `brew install hadolint` (macOS) | Dockerfile linter |\n\n## Commands\n\n### `/setup`\n\nInteractive setup wizard for configuring the complete Dockerfile development environment.\n\n**What it does:**\n\n1. **Verifies Docker installation** - Checks `docker` CLI is available\n2. **Installs docker-langserver** - LSP server for IDE features\n3. **Installs hadolint** - Dockerfile linter\n4. **Validates LSP config** - Confirms `.lsp.json` is correct\n5. **Verifies hooks** - Confirms hooks are properly loaded\n\n**Usage:**\n\n```bash\n/setup\n```\n\n## Project Structure\n\n```\ndockerfile-lsp/\n├── .claude-plugin/\n│   └── plugin.json           # Plugin metadata\n├── .lsp.json                  # docker-langserver configuration\n├── commands/\n│   └── setup.md              # /setup command\n├── hooks/\n│   ├── hooks.json            # Hook definitions\n│   └── scripts/\n│       └── dockerfile-hooks.sh  # Hook dispatcher\n├── tests/\n│   └── Dockerfile            # Sample multi-stage Dockerfile\n├── CLAUDE.md                  # Project instructions\n└── README.md                  # This file\n```\n\n## Troubleshooting\n\n### docker-langserver not starting\n\n1. Ensure Dockerfile exists in project\n2. Verify installation: `docker-langserver --version`\n3. Check LSP config: `cat .lsp.json`\n4. Ensure file is named `Dockerfile` or has `.dockerfile` extension\n\n### hadolint not linting\n\n1. Verify installation: `hadolint --version`\n2. Run manually: `hadolint Dockerfile`\n3. Check for `.hadolint.yaml` configuration conflicts\n\n### Hooks not triggering\n\n1. Verify hooks are loaded: `cat hooks/hooks.json`\n2. Check file patterns match your structure\n3. Ensure tools are installed (`command -v hadolint`)\n\n### Docker build check fails\n\n1. Ensure Docker daemon is running\n2. Check Dockerfile syntax with `docker build --check`\n3. Note: `docker build --check` requires Docker 23.0+\n\n## Configuration\n\n### .hadolint.yaml\n\nCustomize hadolint rules for your project:\n\n```yaml\n# .hadolint.yaml\nignored:\n  - DL3006  # Always tag the version of an image explicitly\n  - DL3018  # Pin versions in apk add\n\ntrustedRegistries:\n  - docker.io\n  - gcr.io\n\noverride:\n  error:\n    - DL3001  # Ignore absolute WORKDIR\n  warning:\n    - DL3042  # Avoid cache busting with apt-get\n```\n\n### Dockerfile Best Practices\n\nThe hooks enforce and suggest:\n\n- **Multi-stage builds** for smaller images\n- **Layer caching** optimization\n- **Version pinning** for base images and packages\n- **Non-root user** for security\n- **COPY instead of ADD** unless needed\n- **Minimal layers** by combining RUN commands\n- **.dockerignore** for build context optimization\n\n## Common Hadolint Rules\n\n| Rule | Description | Severity |\n|------|-------------|----------|\n| DL3000 | Use absolute WORKDIR | Warning |\n| DL3002 | Don't switch to root USER | Warning |\n| DL3008 | Pin versions in apt-get install | Warning |\n| DL3009 | Delete apt-get lists after installing | Info |\n| DL3015 | Avoid additional packages in yum install | Info |\n| DL3025 | Use JSON notation for CMD and ENTRYPOINT | Warning |\n| DL4006 | Use SHELL to change the default shell | Warning |\n\n## License\n\nMIT\n","funding_links":["https://github.com/sponsors/zircote"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzircote%2Fdockerfile-lsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzircote%2Fdockerfile-lsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzircote%2Fdockerfile-lsp/lists"}