197
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill leavesfly/jimi --skill docker-setup- docker-check.sh1.4 KB
- SKILL.md1.2 KB
Overview
This skill provides a practical Docker containerization guide focused on Java Spring Boot applications. It bundles a recommended multi-stage Dockerfile, a Docker Compose example for app+MySQL, and commonly used Docker commands. The content is aimed at making builds reproducible, images lean, and local deployments consistent.
How this skill works
The skill shows how to use a multi-stage Dockerfile: build the artifact with Maven in a build stage, then copy the produced JAR into a slim runtime image to keep final images small. It includes a Docker Compose file to orchestrate the application and a MySQL service with a persistent volume. Common CLI commands are provided for building images, running containers, inspecting logs, and entering containers for debugging.
When to use it
- Packaging a Spring Boot application for consistent runtime across environments
- Setting up a local development stack with application and database using Docker Compose
- Optimizing CI pipelines by building artifacts in a separate build stage
- Reducing final image size and attack surface for production deployments
- Quickly reproducing bugs by running the exact image used in CI or production
Best practices
- Use multi-stage builds: compile in a full image (Maven) and copy the artifact into a minimal JRE image
- Expose only required ports and avoid running as root inside the container
- Externalize configuration via environment variables or mounted config files; use secrets for credentials
- Mount persistent volumes for stateful services like databases to avoid data loss
- Add healthchecks and graceful shutdown support so orchestration tools can manage restarts properly
- Keep images small by using slim base images and cleaning build caches
Example use cases
- Local development: spin up app + MySQL with docker-compose and iterate quickly
- CI pipeline: build artifact in a builder stage, run lightweight tests in the runtime image
- Production deployment: publish the optimized runtime image to a registry and deploy to orchestrators
- Debugging: run container locally, use docker logs and docker exec to inspect runtime issues
- Migration: containerize database-dependent apps to standardize environments across teams
FAQ
Use multi-stage builds, choose slim or distroless base images, and avoid copying build caches or source files into the runtime image.
How do I persist database data across container restarts?
Declare and mount a named volume for the database service in docker-compose (or bind a host directory) so the database files live outside the container lifecycle.