# java-docker

java-docker prepares lean, hardened Docker containers for Java and Spring Boot workloads with container-aware JVM flags.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 267 installs · ★ 42 repo stars
- Author: pluginagentmarketplace
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pluginagentmarketplace/custom-plugin-java/tree/HEAD/skills/java-docker/SKILL.md
- Updated: 2026-01-05
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/java-docker

## What it does

The skill guides your agent in drafting multi-stage container builds for Java services. When working with Spring Boot, it splits application artifacts using `layertools`. Dependency updates get cached cleanly.

Memory configuration addresses container constraints directly. The instructions inject `UseContainerSupport`, set `MaxRAMPercentage` to 75.0, pick G1GC, and activate `ExitOnOutOfMemoryError`. Runtimes older than Java 11 cannot inspect cgroup limits reliably, leading directly to `OOMKilled` terminations.

Hardening comes enabled in the generated files. Root execution is disabled via a dedicated `app` user, and readiness probes link to `actuator/health`.

## Requirements
- Works with: Docker

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-docker -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/java-docker/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/java-docker/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-docker -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/java-docker/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-docker -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/java-docker/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pluginagentmarketplace/custom-plugin-java skills/java-docker
```

2. **Manually: put the files in place**
- File: `.github/skills/java-docker/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-docker -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pluginagentmarketplace/custom-plugin-java --path skills/java-docker
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/java-docker/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-docker -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pluginagentmarketplace/custom-plugin-java/tree/HEAD/skills/java-docker/SKILL.md

## When to use it
- write a multi-stage Dockerfile for a Spring Boot service
- tune container-aware JVM memory flags to prevent sudden kills
- shrink container footprint using Alpine or Distroless bases
- isolate the runtime process under an unprivileged user

## Example prompts
- Create a multi-stage Dockerfile for my Spring Boot app on Java 21
- Configure JVM container options with MaxRAMPercentage set to 75.0
- Harden this Java Docker container with a non-root user and distroless base

## Similar
- [706-technologies-containers-docker](https://affpapa.org/en/nevibecode/skills/706-technologies-containers-docker.md) — skill · 225 installs
- [docker-containerization](https://affpapa.org/en/nevibecode/skills/curiositech-docker-containerization.md) — skill · 143 installs
- [docker-expert](https://affpapa.org/en/nevibecode/skills/sickn33-docker-expert.md) — skill · 27500 installs
- [docker-patterns](https://affpapa.org/en/nevibecode/skills/docker-patterns.md) — skill · 8600 installs
- [docker-build-strategies](https://affpapa.org/en/nevibecode/skills/docker-build-strategies.md) — skill · 2200 installs
- [docker](https://affpapa.org/en/nevibecode/skills/mindrally-docker.md) — skill · 1200 installs

From the same set: [pluginagentmarketplace/custom-plugin-java](https://affpapa.org/en/nevibecode/by/pluginagentmarketplace/custom-plugin-java.md) — 12 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
