{"id":17132085,"url":"https://github.com/isaul32/spring-boot-native-from-scratch-sample","last_synced_at":"2026-05-11T02:03:23.461Z","repository":{"id":107738942,"uuid":"607845594","full_name":"isaul32/spring-boot-native-from-scratch-sample","owner":"isaul32","description":"Spring Boot 3 Native Image sample from Docker scratch","archived":false,"fork":false,"pushed_at":"2023-03-06T12:29:10.000Z","size":64,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T11:12:49.498Z","etag":null,"topics":["docker","graalvm","graalvm-native-image","java","spring-boot","spring-native"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/isaul32.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}},"created_at":"2023-02-28T19:46:44.000Z","updated_at":"2024-09-09T12:30:29.000Z","dependencies_parsed_at":"2023-06-08T22:37:14.778Z","dependency_job_id":null,"html_url":"https://github.com/isaul32/spring-boot-native-from-scratch-sample","commit_stats":null,"previous_names":["isaul32/spring-boot-native-from-scratch-sample"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaul32%2Fspring-boot-native-from-scratch-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaul32%2Fspring-boot-native-from-scratch-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaul32%2Fspring-boot-native-from-scratch-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaul32%2Fspring-boot-native-from-scratch-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isaul32","download_url":"https://codeload.github.com/isaul32/spring-boot-native-from-scratch-sample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245212311,"owners_count":20578443,"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":["docker","graalvm","graalvm-native-image","java","spring-boot","spring-native"],"created_at":"2024-10-14T19:25:58.776Z","updated_at":"2026-05-11T02:03:23.384Z","avatar_url":"https://github.com/isaul32.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot 3 Native Image sample from Docker scratch\n\n- Only Linux amd64 is supported at the moment!\n\n## Build and run\n\n```shell\n# Build the native image from scratch\ndocker build -t native-sample .\n\n# Let's look at the layers\ndive native-sample\n# ┃ ● Layers ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │ Current Layer Contents ├───────────────────────────────────────────\n# Cmp   Size  Command                                                   Permission     UID:GID       Size  Filetree\n#        0 B  FROM a9b99f883087b4c                                      -rwxr-xr-x         0:0      17 MB  ├── native-sample\n#      17 MB  COPY /app/build/native/nativeCompile/native-sample . # bu drwxr-xr-x         0:0        0 B  └── tmp\n# \n# │ Layer Details ├────────────────────────────────────────────────────\n\n\n# Or only inspect size of the image\ndocker inspect -f \"{{ .Size }}\" native-sample | numfmt --to=si\n# 17M\n\n# Run the image\ndocker run -it --rm -p 8080:8080 native-sample\n#   .   ____          _            __ _ _\n#  /\\\\ / ___'_ __ _ _(_)_ __  __ _ \\ \\ \\ \\\n# ( ( )\\___ | '_ | '_| | '_ \\/ _` | \\ \\ \\ \\\n#  \\\\/  ___)| |_)| | | | | || (_| |  ) ) ) )\n#   '  |____| .__|_| |_|_| |_\\__, | / / / /\n#  =========|_|==============|___/=/_/_/_/\n#  :: Spring Boot ::                (v3.0.3)\n# \n# 2023-02-28T21:10:09.282Z  INFO 1 --- [           main] l.s.n.NativeSampleApplication            : Starting AOT-processed NativeSampleApplication using Java 17.0.6 with PID 1 (/native-sample started by ? in /)\n# 2023-02-28T21:10:09.282Z  INFO 1 --- [           main] l.s.n.NativeSampleApplication            : No active profile set, falling back to 1 default profile: \"default\"\n# 2023-02-28T21:10:09.293Z  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)\n# 2023-02-28T21:10:09.293Z  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]\n# 2023-02-28T21:10:09.293Z  INFO 1 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.5]\n# 2023-02-28T21:10:09.298Z  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext\n# 2023-02-28T21:10:09.298Z  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 16 ms\n# 2023-02-28T21:10:09.327Z  WARN 1 --- [           main] i.m.c.i.binder.jvm.JvmGcMetrics          : GC notifications will not be available because MemoryPoolMXBeans are not provided by the JVM\n# 2023-02-28T21:10:09.329Z  INFO 1 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 1 endpoint(s) beneath base path '/actuator'\n# 2023-02-28T21:10:09.332Z  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''\n# 2023-02-28T21:10:09.332Z  INFO 1 --- [           main] l.s.n.NativeSampleApplication            : Started NativeSampleApplication in 0.056 seconds (process running for 0.057)\n\n# Navigate to http://localhost:8080/actuator/health\n```\n\n## Results\n\n- Build time: 202 s (3.3 min)\n- Image size: 17 MB\n- Startup time: 56 ms\n- Memory consumption at the beginning: 124MB\n\nComputer specs:\n- CPU: Intel i5-6600K\n- Memory: 48 GB, DDR4\n- OS: Linux 5.10\n- Docker: 23.0.1\n\n## Spring recommended way\n\n```shell\n# Use Cloud Native Buildpacks\n./gradlew bootBuildImage\n# Size 98M\n\n# Run the image\ndocker run -it --rm -p 8080:8080 native-sample\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaul32%2Fspring-boot-native-from-scratch-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisaul32%2Fspring-boot-native-from-scratch-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaul32%2Fspring-boot-native-from-scratch-sample/lists"}