{"id":21591046,"url":"https://github.com/tuananh/how-small-can-it-be","last_synced_at":"2026-01-04T14:03:03.117Z","repository":{"id":142279260,"uuid":"583732450","full_name":"tuananh/how-small-can-it-be","owner":"tuananh","description":"How small can a Java application container image be","archived":false,"fork":false,"pushed_at":"2023-02-17T10:41:29.000Z","size":48,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-24T16:29:01.577Z","etag":null,"topics":["apko","chainguard","graalvm","melange","wolfi"],"latest_commit_sha":null,"homepage":"","language":"Makefile","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/tuananh.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":"2022-12-30T18:21:19.000Z","updated_at":"2024-06-10T12:07:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a741633-301d-4c83-8ceb-e93a16fef6a4","html_url":"https://github.com/tuananh/how-small-can-it-be","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/tuananh%2Fhow-small-can-it-be","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuananh%2Fhow-small-can-it-be/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuananh%2Fhow-small-can-it-be/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuananh%2Fhow-small-can-it-be/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuananh","download_url":"https://codeload.github.com/tuananh/how-small-can-it-be/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244198406,"owners_count":20414443,"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":["apko","chainguard","graalvm","melange","wolfi"],"created_at":"2024-11-24T16:22:21.905Z","updated_at":"2026-01-04T14:03:03.016Z","avatar_url":"https://github.com/tuananh.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"How small can it be?\n--------------------\n\n# Pretty damn small!\n\nA demonstration using [GraalVM](https://www.graalvm.org/) native image, [melange](https://github.com/chainguard-dev/melange), [apko](https://github.com/chainguard-dev/apko) \u0026 [Wolfi Linux](https://github.com/wolfi-dev/os) to build a tiny tiny Java application.\n\nThe end goal is to see how small Java application container image can be.\n\n## How?\n\n- Since there's no GraalVM package for Wolfi Linux, I just need to quickly package it in a dirty way using [melange](https://github.com/chainguard-dev/melange).\n\n- After that, I package [my application](./src/App.java) with melange again, using the `native-image` package from the Melange package I got earlier.\n\n- Finally, I use [apko](https://github.com/chainguard-dev/apko) to produce the final container image. You can do multi-arch easily with apko along with other benefits like automatic SBOM generation, reproducible by default, etc.. but for the scope of this weekend hack, I just do `amd64` only.\n\n```sh\nmake native-image-pkg\nmake tiny-java-app-pkg\nmake container-image\ndocker load \u003c tiny-java-app.tar\ndocker run tiny-java-app:latest\n```\n\n## Result\n\nThe image is 23.1 MB decompressed and 8.6MB compressed.\n\nAlong with all other benefits of the Chainguard's stack:\n\n- Fully reproducible by default\n- SBOM support\n- Multi-arch\n- etc...\n\n```\ndocker images | grep tiny\ntiny-java-app                                 latest         80ac5468534c   53 years ago    23.1MB\n```\n\n![result](./result.png)\n\n## License\n\nCopyright 2023 Tuan Anh Tran \u003cme@tuananh.org\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuananh%2Fhow-small-can-it-be","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuananh%2Fhow-small-can-it-be","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuananh%2Fhow-small-can-it-be/lists"}