{"id":18826251,"url":"https://github.com/otaviojava/hello-world-docker","last_synced_at":"2025-07-18T03:38:40.986Z","repository":{"id":141704426,"uuid":"186172623","full_name":"otaviojava/hello-world-docker","owner":"otaviojava","description":"A Hello world docker with Java","archived":false,"fork":false,"pushed_at":"2019-05-16T19:12:29.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-30T05:29:16.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/otaviojava.png","metadata":{"files":{"readme":"README.asciidoc","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}},"created_at":"2019-05-11T19:16:17.000Z","updated_at":"2019-09-18T08:57:12.000Z","dependencies_parsed_at":"2024-04-19T05:31:02.690Z","dependency_job_id":null,"html_url":"https://github.com/otaviojava/hello-world-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviojava%2Fhello-world-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviojava%2Fhello-world-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviojava%2Fhello-world-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviojava%2Fhello-world-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otaviojava","download_url":"https://codeload.github.com/otaviojava/hello-world-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239763670,"owners_count":19692800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-08T01:03:43.661Z","updated_at":"2025-02-20T01:46:31.722Z","avatar_url":"https://github.com/otaviojava.png","language":"Java","readme":"== Hello World with Docker\n\n\n\n[source,bash]\n----\n mvn clean package\n java -cp target/hello-world-docker-1.0-SNAPSHOT.jar App\n----\n\n\n[source,bash]\n----\ndocker container run -it openjdk:8\nroot@bd2947d4d562:/# java -version\nopenjdk version \"1.8.0_212\"\nOpenJDK Runtime Environment (build 1.8.0_212-8u212-b01-1~deb9u1-b01)\nOpenJDK 64-Bit Server VM (build 25.212-b01, mixed mode)\nroot@bd2947d4d562:/# exit\nexit\n----\n\n\nCreate a new Dockerfile and use the following content:\n\n[source,Dockerfile]\n----\nFROM openjdk:8\nCOPY target/docker-1.0-SNAPSHOT.jar /usr/src/docker-1.0-SNAPSHOT.jar\nCMD java -cp /usr/src/docker-1.0-SNAPSHOT.jar  App\n----\n\n\nBuild the image:\n\n[source,bash]\n----\ndocker image build -t hello-world-docker-java:latest .\n----\n\nRun the image:\n\n[source,bash]\n----\ndocker container run hello-world-docker-java:latest\n----\n\nSet the maven plugin:\n\n[source,bash]\n----\nmvn clean package docker:build\n----\n\n== Docker War\n\nSet the maven plugin:\n\n[source,bash]\n----\nmvn clean package docker:build\n----\n\nRun the image:\n\n[source,bash]\n----\ndocker container run -p 8080:8080 -e JAVA_OPTS='-Xmx100m' hello-world-java-war\n----\n\nTo Test:\n\n[source,bash]\n----\ncurl -X GET http://localhost:8080/hello-world/resource/hello\n----\n\n\n== Docker Uber Jar\n\n\n[source,bash]\n----\nmvn clean install tomee:exec docker:build\n----\n\n[source,bash]\n----\ndocker container run -p 8080:8080 -e JAVA_OPTS='-Xmx100m' hello-world-uber-jar\n----\n\nTo Test:\n\n[source,bash]\n----\ncurl -X GET http://localhost:8080/hello-world/resource/hello\n----\n\n\n== Docker Compose\n\nServer Up\n\n[source,bash]\n----\ndocker-compose up -d\n----\n\nTest it:\n\n[source,bash]\n----\ncurl -X GET http://localhost/hello-world/resource/hello\n----\n\nServer Down\n\n[source,bash]\n----\ndocker-compose down\n----","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotaviojava%2Fhello-world-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotaviojava%2Fhello-world-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotaviojava%2Fhello-world-docker/lists"}