Skip to content

Commit

Permalink
Move tiny-java-containers under native-image/containerize category
Browse files Browse the repository at this point in the history
  • Loading branch information
olyagpl committed Dec 18, 2024
1 parent 4084651 commit c23898d
Show file tree
Hide file tree
Showing 28 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
name: tiny-java-containers
name: native-image/containerize/tiny-java-containers
on:
push:
paths:
- 'tiny-java-containers/**'
- '.github/workflows/tiny-java-containers.yml'
- 'native-image/containerize/tiny-java-containers/**'
- '.github/workflows/containerize-tiny-java-containers.yml'
schedule:
- cron: "0 0 1 * *" # run every month
workflow_dispatch:
permissions:
contents: read
jobs:
run:
name: Run 'tiny-java-containers'
name: Run 'native-image/containerize/tiny-java-containers'
runs-on: ubuntu-20.04 # Docker has changed its behavior on Ubuntu 22.04
timeout-minutes: 20
strategy:
matrix:
java-version: ['21', '24-ea']
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
java-version: ${{ matrix.java-version }}
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run 'tiny-java-containers'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ shared libraries, an executable has to be fully statically linked with all
needed libraries and resources.

To support static linking of `libc`, GraalVM Native Image supports using the
"lightweight, fast, simple, free" [musl](https://musl.libc.org/) libc
"lightweight, fast, simple, free" [musl](https://musl.libc.org/) `libc`
implementation.

You can watch a [Devoxx 2022](https://devoxx.be/) session that walks through
Expand Down Expand Up @@ -176,15 +176,13 @@ or
![](images/keyboard.jpg) `docker run --init --rm -p8000:8000 jwebserver:scratch.static-upx`

Using `curl` or your favourite tool you can hit `http://localhost:8000` to fetch
the index.html file.
the _index.html_ file.

## Wrapping Up

A fully functional, albeit minimal, Java "microservice" was compiled into a
native Linux executable and packaged into Distroless, Alpine, and
`scratch`-based container images thanks to GraalVM Native Image's support for
various linking options including fully static linking with the `musl` libc.
various linking options including fully static linking with `musl libc`.

To learn more about linking options check out [Static and Mostly Static
Images](https://www.graalvm.org/latest/reference-manual/native-image/guides/build-static-executables/)
in the GraalVM docs.
To learn more about linking options check out [Static and Mostly Static Images](https://www.graalvm.org/latest/reference-manual/native-image/guides/build-static-executables/) in the GraalVM docs.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.

0 comments on commit c23898d

Please sign in to comment.