{"id":28919690,"url":"https://github.com/buzzcosm/hello-docker","last_synced_at":"2026-04-15T05:31:25.008Z","repository":{"id":296461688,"uuid":"993476093","full_name":"buzzcosm/hello-docker","owner":"buzzcosm","description":"A simple Spring Boot application demonstrating various Docker containerization approaches for Java applications.","archived":false,"fork":false,"pushed_at":"2025-06-04T07:48:44.000Z","size":233,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-01T12:47:35.985Z","etag":null,"topics":["docker","docker-compose","docker-image","graalvm-native-image","java-21-lts","maven","spring-boot"],"latest_commit_sha":null,"homepage":"","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/buzzcosm.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}},"created_at":"2025-05-30T21:26:36.000Z","updated_at":"2025-06-04T07:48:45.000Z","dependencies_parsed_at":"2025-05-31T07:58:48.600Z","dependency_job_id":"77f22094-99be-45c5-9436-8d1dafc5fd57","html_url":"https://github.com/buzzcosm/hello-docker","commit_stats":null,"previous_names":["buzzcosm/hello-docker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/buzzcosm/hello-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buzzcosm%2Fhello-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buzzcosm%2Fhello-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buzzcosm%2Fhello-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buzzcosm%2Fhello-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buzzcosm","download_url":"https://codeload.github.com/buzzcosm/hello-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buzzcosm%2Fhello-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31828530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker","docker-compose","docker-image","graalvm-native-image","java-21-lts","maven","spring-boot"],"created_at":"2025-06-22T04:00:38.047Z","updated_at":"2026-04-15T05:31:25.001Z","avatar_url":"https://github.com/buzzcosm.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hello Docker\n\nA simple Spring Boot application demonstrating various Docker containerization approaches for Java applications.\n\n## Description\n\nThis project showcases how to containerize a Spring Boot application using different Docker strategies:\n- Standard JAR-based containerization\n- Multi-stage builds for optimized images\n- GraalVM native image compilation for smaller footprint and faster startup\n\nThe application itself is a minimal REST API with a single endpoint:\n- `GET /` - Returns the greeting message \"Hello Docker 👋\"\n\n## Prerequisites\n\n- Java 21\n- Docker\n- Docker Compose\n- Maven 3.9+ (or use the included Maven wrapper)\n\n## Getting Started\n\n### Clone the Repository\n\n```bash\ngit clone https://github.com/buzzcosm/hello-docker.git\ncd hello-docker\n```\n\n### Build and Run Locally\n\n```bash\n./mvnw clean package\njava -jar target/hello-docker.jar\n```\n\nThe application will be available at http://localhost:8080\n\n## 🐳 Docker Containerization Benchmark\n\n![Docker Containerization Benchmark](./docs/pictures/docker-containerization-benchmark.png)\n\n## 🐳🔧 Dockerfile commands\n\n* FROM initializes the build stage and defines the base image to build on.\n* WORKDIR sets the working directory for any RUN, CMD, ENTRYPOINT, COPY, and ADD directives that follow in the Dockerfile.\n* COPY copies new files or directories into the Docker image.\n* RUN executes commands on top of the current image as a new layer and commits the results.\n* EXPOSE configures Docker to open a specific network port for listening on the container, in this case port 8080.\n* ENV sets environment variables.\n* CMD provides the default execution command when the container is run.\n\n## 🧪 Automated Build \u0026 Test Scripts\n\n**s.** *directory*: `scripts/build_and_test_image_v*.sh`\n\nThis script will:\n- Check if Docker is running\n- Automatically build the image\n- Start the container using docker-compose.yml\n- Test the HTTP response for the string Hello Docker\n- Print the result\n- Stop and remove the container afterward\n\n## 🧩(optional) Java containers with Jib\n\n- [Building Java containers with Jib](https://cloud.google.com/java/getting-started/jib)\n\nHelper - Get Digest if image:\n\n\u003e `docker inspect \u003cimage\u003e:\u003ctag\u003e --format='{{index .RepoDigests 0}}'`\n\n### Build Docker Image\n\n```shell\n./mvnw clean compile jib:dockerBuild\n```\n\n### Test\n\n```shell\ndocker run --platform linux/amd64 -it --rm -p 8080:8080 --name hello-docker-jib hello-docker:jib  \n```\n\n## 🧩(optional) Spring-Boot Container\n\n- [Packaging OCI Images](https://docs.spring.io/spring-boot/maven-plugin/build-image.html)\n\n```shell\n./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=hello-docker:spring-boot-build\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuzzcosm%2Fhello-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuzzcosm%2Fhello-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuzzcosm%2Fhello-docker/lists"}