{"id":25976166,"url":"https://github.com/kh77/hello-world-docker","last_synced_at":"2026-04-18T02:33:02.851Z","repository":{"id":119364171,"uuid":"273074370","full_name":"kh77/hello-world-docker","owner":"kh77","description":"Docker example in Spring Boot","archived":false,"fork":false,"pushed_at":"2020-06-17T20:54:14.000Z","size":29437,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T15:50:37.299Z","etag":null,"topics":["docker","java","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kh77.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-06-17T20:42:56.000Z","updated_at":"2023-06-07T11:09:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff168e65-ddaa-432a-836c-9ec6fd98af97","html_url":"https://github.com/kh77/hello-world-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kh77/hello-world-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kh77%2Fhello-world-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kh77%2Fhello-world-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kh77%2Fhello-world-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kh77%2Fhello-world-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kh77","download_url":"https://codeload.github.com/kh77/hello-world-docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kh77%2Fhello-world-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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","java","spring-boot"],"created_at":"2025-03-05T03:35:28.426Z","updated_at":"2026-04-18T02:33:02.836Z","avatar_url":"https://github.com/kh77.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hello World Rest API\n\n### Building an Image\n\n1. Build a Jar - /target/hello-world-docker.jar\n2. Setup the Prerequisites for Running the JAR - openjdk:8-jdk-alpine\n3. Copy the jar\n4. Run the jar\n\n### Docker Commands - Creating Image Manually\n\n- docker run -dit openjdk:8-jdk-alpine\n- docker container exec naughty_knuth ls /tmp\n- docker container cp target/hello-world-docker.jar naughty_knuth:/tmp\n- docker container exec naughty_knuth ls /tmp\n- docker container commit naughty_knuth kh77/hello-world-docker:manual1\n- docker run kh77/hello-world-docker:manual1\n- docker container ls\n- docker container commit --change='CMD [\"java\",\"-jar\",\"/tmp/hello-world-docker.jar\"]' naughty_knuth kh77/hello-world-docker:manual2\n- docker run -p 8080:8080 kh77/hello-world-docker:manual2\n\n\n### Running the Application\n\nRun RestfulWebServicesApplication as a Java Application.\n\n- http://localhost:8080/hello-world\n\n```txt\nHello World\n```\n\n- http://localhost:8080/hello-world-bean\n\n```json\n{\"message\":\"Hello World\"}\n```\n\n- http://localhost:8080/hello-world/path-variable/kh77\n\n```json\n{\"message\":\"Hello World, practice\"}\n```\n\n## Docker File\n\n### Basic\n```\nFROM openjdk:8-jdk-alpine\nEXPOSE 8080\nADD target/hello-world-docker.jar hello-world-docker.jar\nENTRYPOINT [\"sh\", \"-c\", \"java -jar /hello-world-docker.jar\"]\n```\n\n### Level 2\n\n```\nFROM openjdk:8-jdk-alpine\nARG DEPENDENCY=target/dependency\nCOPY ${DEPENDENCY}/BOOT-INF/lib /app/lib\nCOPY ${DEPENDENCY}/META-INF /app/META-INF\nCOPY ${DEPENDENCY}/BOOT-INF/classes /app\nENTRYPOINT [\"java\",\"-cp\",\"app:app/lib/*\",\"RestfulWebServicesApplication\"]\n```\n\n## Plugins\n\n### Dockerfile Maven\n\n- From Spotify\n- https://github.com/spotify/dockerfile-maven\n\n```\n\u003cplugin\u003e\n\t\u003cgroupId\u003ecom.spotify\u003c/groupId\u003e\n\t\u003cartifactId\u003edockerfile-maven-plugin\u003c/artifactId\u003e\n\t\u003cversion\u003e1.4.10\u003c/version\u003e\n\t\u003cexecutions\u003e\n\t\t\u003cexecution\u003e\n\t\t\t\u003cid\u003edefault\u003c/id\u003e\n\t\t\t\u003cgoals\u003e\n\t\t\t\t\u003cgoal\u003ebuild\u003c/goal\u003e\n\t\t\t\u003c/goals\u003e\n\t\t\u003c/execution\u003e\n\t\u003c/executions\u003e\n\t\u003cconfiguration\u003e\n\t\t\u003crepository\u003ekh77/${project.name}\u003c/repository\u003e\n\t\t\u003ctag\u003e${project.version}\u003c/tag\u003e\n\t\t\u003cskipDockerInfo\u003etrue\u003c/skipDockerInfo\u003e\n\t\u003c/configuration\u003e\n\u003c/plugin\u003e\n```\n\n\ndocker build -t kh77/hello-world-docker:dockerfile1 .\n\n\nfor jib kazim\nContainerizing application to Docker daemon as 01-hello-world-docker:0.0.1-SNAPSHOT...\n\n### JIB\n\n- https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin#quickstart\n\n- https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md\n\n#### \"useCurrentTimestamp - true\" discussion\n- https://github.com/GooleContainerTools/jib/blob/master/docs/faq.md#why-is-my-image-created-48-years-ago \n- https://github.com/GoogleContainerTools/jib/issues/413 \n\n```\n\u003cplugin\u003e\n\t\u003cgroupId\u003ecom.google.cloud.tools\u003c/groupId\u003e\n\t\u003cartifactId\u003ejib-maven-plugin\u003c/artifactId\u003e\n\t\u003cversion\u003e1.6.1\u003c/version\u003e\n\t\u003cconfiguration\u003e\n\t\t\u003ccontainer\u003e\n\t\t\t\u003ccreationTime\u003eUSE_CURRENT_TIMESTAMP\u003c/creationTime\u003e\n\t\t\u003c/container\u003e\n\t\u003c/configuration\u003e\n\t\u003cexecutions\u003e\n\t\t\u003cexecution\u003e\n\t\t\t\u003cphase\u003epackage\u003c/phase\u003e\n\t\t\t\u003cgoals\u003e\n\t\t\t\t\u003cgoal\u003edockerBuild\u003c/goal\u003e\n\t\t\t\u003c/goals\u003e\n\t\t\u003c/execution\u003e\n\t\u003c/executions\u003e\n\u003c/plugin\u003e\n```\n```\n\u003cconfiguration\u003e\n\t\u003cfrom\u003e\n\t\t\u003cimage\u003eopenjdk:alpine\u003c/image\u003e\n\t\u003c/from\u003e\n\t\u003cto\u003e\n\t\t\u003cimage\u003ekh77/${project.name}\u003c/image\u003e\n\t\t\u003ctags\u003e\n\t\t\t\u003ctag\u003e${project.version}\u003c/tag\u003e\n\t\t\t\u003ctag\u003elatest\u003c/tag\u003e\n\t\t\u003c/tags\u003e\n\t\u003c/to\u003e\n\t\u003ccontainer\u003e\n\t\t\u003cjvmFlags\u003e\n\t\t\t\u003cjvmFlag\u003e-Xms512m\u003c/jvmFlag\u003e\n\t\t\u003c/jvmFlags\u003e\n\t\t\u003cmainClass\u003eRestfulWebServicesApplication\u003c/mainClass\u003e\n\t\t\u003cports\u003e\n\t\t\t\u003cport\u003e8100\u003c/port\u003e\n\t\t\u003c/ports\u003e\n\t\u003c/container\u003e\n\u003c/configuration\u003e\n```\n\n### fabric8io/docker-maven-plugin\n\n- https://dmp.fabric8.io/\n- Remove Spotify Maven and JIB Plugins. Add the plugin shown below and configure property for jar file.\n\nSupports \n - Dockerfile\n - Defining Dockerfile contents in POM XML. \n\n#### Using Dockerfile\n\n```\n\u003c!-- To build the image - \"mvn clean package\" --\u003e\n\u003c!-- Successfully tagged webservices/01-hello-world-docker --\u003e\n\u003c!-- docker run -p 8080:8080 webservices/01-hello-world-docker --\u003e\n\u003cplugin\u003e\n\t\u003cgroupId\u003eio.fabric8\u003c/groupId\u003e\n\t\u003cartifactId\u003edocker-maven-plugin\u003c/artifactId\u003e\n\t\u003cversion\u003e0.26.0\u003c/version\u003e\n\t\u003cexecutions\u003e\n\t\t\u003cexecution\u003e\n\t\t\t\u003cid\u003edocker-build\u003c/id\u003e\n\t\t\t\u003cphase\u003epackage\u003c/phase\u003e\n\t\t\t\u003cgoals\u003e\n\t\t\t\t\u003cgoal\u003ebuild\u003c/goal\u003e\n\t\t\t\u003c/goals\u003e\n\t\t\u003c/execution\u003e\n\t\u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n```\n\u003cproperties\u003e\n...\n \u003cjar\u003e${project.build.directory}/${project.build.finalName}.jar\u003c/jar\u003e\n\u003c/properties\u003e\n```\n\n#### Using XML Configuration\n\n```\n\u003c!-- To build the image - \"mvn clean package\" --\u003e\n\u003c!-- TAG - 01-hello-world-docker:latest --\u003e\n\u003c!-- docker run -p 8080:8080 01-hello-world-docker:latest --\u003e\n\u003cplugin\u003e\n   \u003cgroupId\u003eio.fabric8\u003c/groupId\u003e\n   \u003cartifactId\u003edocker-maven-plugin\u003c/artifactId\u003e\n   \u003cversion\u003e0.26.0\u003c/version\u003e\n   \u003cextensions\u003etrue\u003c/extensions\u003e\n   \u003cconfiguration\u003e\n      \u003cverbose\u003etrue\u003c/verbose\u003e\n      \u003cimages\u003e\n         \u003cimage\u003e\n            \u003cname\u003e${project.artifactId}\u003c/name\u003e\n            \u003cbuild\u003e\n               \u003cfrom\u003ejava:8-jdk-alpine\u003c/from\u003e\n               \u003centryPoint\u003e\n                  \u003cexec\u003e\n                     \u003cargs\u003ejava\u003c/args\u003e\n                     \u003cargs\u003e-jar\u003c/args\u003e\n                     \u003cargs\u003e/maven/${project.build.finalName}.jar\u003c/args\u003e\n                  \u003c/exec\u003e\n               \u003c/entryPoint\u003e\n               \u003cassembly\u003e\n                  \u003cdescriptorRef\u003eartifact\u003c/descriptorRef\u003e\n               \u003c/assembly\u003e\n            \u003c/build\u003e\n         \u003c/image\u003e\n      \u003c/images\u003e\n   \u003c/configuration\u003e\n   \u003cexecutions\u003e\n\t\u003cexecution\u003e\n\t\t\u003cid\u003edocker-build\u003c/id\u003e\n\t\t\u003cphase\u003epackage\u003c/phase\u003e\n\t\t\u003cgoals\u003e\n\t\t\t\u003cgoal\u003ebuild\u003c/goal\u003e\n\t\t\u003c/goals\u003e\n\t\u003c/execution\u003e\n   \u003c/executions\u003e\n\u003c/plugin\u003e\n ```\n \n### Maven Dependency Plugin\n\n```\n\u003cplugin\u003e\t\n\t\u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n\t\u003cartifactId\u003emaven-dependency-plugin\u003c/artifactId\u003e\n\t\u003cexecutions\u003e\n\t\t\u003cexecution\u003e\n\t\t\t\u003cid\u003eunpack\u003c/id\u003e\n\t\t\t\u003cphase\u003epackage\u003c/phase\u003e\n\t\t\t\u003cgoals\u003e\n\t\t\t\t\u003cgoal\u003eunpack\u003c/goal\u003e\n\t\t\t\u003c/goals\u003e\n\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\u003cartifactItems\u003e\n\t\t\t\t\t\u003cartifactItem\u003e\n\t\t\t\t\t\t\u003cgroupId\u003e${project.groupId}\u003c/groupId\u003e\n\t\t\t\t\t\t\u003cartifactId\u003e${project.artifactId}\u003c/artifactId\u003e\n\t\t\t\t\t\t\u003cversion\u003e${project.version}\u003c/version\u003e\n\t\t\t\t\t\u003c/artifactItem\u003e\n\t\t\t\t\u003c/artifactItems\u003e\n\t\t\t\u003c/configuration\u003e\n\t\t\u003c/execution\u003e\n\t\u003c/executions\u003e\n\u003c/plugin\u003e\n```\n \n\n### Improve Caching of Images using Layers\n \n#### CURRENT SITUATION\t\t\t\t\t\n\n\t\t\t--------------- \n\t\t\t    FAT JAR\n\t\t\t--------------- \n\t\t\t      JDK\n\t\t\t--------------- \n\n####  DESIRED SITUATION\n\t\t\t--------------- \n\t\t\t    CLASSES   \n\t\t\t---------------\n\t\t\t DEPENDENCIES \n\t\t\t---------------\n\t\t\t     JDK      \n\t\t\t---------------\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkh77%2Fhello-world-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkh77%2Fhello-world-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkh77%2Fhello-world-docker/lists"}