Accepting request 1186795 from devel:BCI:Tumbleweed
🤖: sync package with devel:BCI:Tumbleweed from OBS OBS-URL: https://build.opensuse.org/request/show/1186795 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/openjdk-17-image?expand=0&rev=12
This commit is contained in:
commit
a94ad853ae
58
README.md
58
README.md
@ -1,7 +1,61 @@
|
||||
# The openSUSE Tumbleweed BCI OpenJDK 17 runtime container image
|
||||
# OpenJDK 17 runtime container image
|
||||
|
||||
![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)
|
||||
|
||||
OpenJDK 17 runtime container based on the openSUSE Tumbleweed Base Container Image.
|
||||
## Description
|
||||
|
||||
[OpenJDK](https://openjdk.org/) (Open Java Development Kit) is a free and open source implementation of the Java Platform, Standard Edition (Java SE). OpenJDK is the official reference implementation of Java SE since version 7.
|
||||
|
||||
The OpenJDK runtime image is intended to be used as a runtime environment. For development, use the OpenJDK development image.
|
||||
|
||||
## Usage
|
||||
|
||||
To run a jar or war application inside a container instance, use the following command:
|
||||
|
||||
```ShellSession
|
||||
$ podman run --rm -v "$PWD":/app:Z -w /app registry.opensuse.org/opensuse/bci/openjdk:17 java -jar hello.jar
|
||||
```
|
||||
|
||||
Or create a new contained based on OpenJDK 17 runtime image:
|
||||
|
||||
```Dockerfile
|
||||
FROM registry.opensuse.org/opensuse/bci/openjdk:17
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . ./
|
||||
|
||||
CMD ["java", "-jar", "hello.jar"]
|
||||
```
|
||||
|
||||
To compile and deploy an application, copy the sources and build the application:
|
||||
|
||||
```Dockerfile
|
||||
# Build the application using the OpenJDK development image
|
||||
FROM registry.suse.com/bci/openjdk-devel:17 as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . ./
|
||||
|
||||
RUN javac Hello.java
|
||||
|
||||
# Bundle the application into OpenJDK runtime image
|
||||
FROM registry.opensuse.org/opensuse/bci/openjdk:17
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/Hello.class /app
|
||||
|
||||
CMD ["java", "Hello"]
|
||||
```
|
||||
|
||||
Build and run the container image:
|
||||
|
||||
```ShellSession
|
||||
$ podman build -t my-java-app .
|
||||
$ podman run -it --rm my-java-app
|
||||
```
|
||||
|
||||
## Licensing
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Jul 11 08:17:40 UTC 2024 - Alexandre Vicenzi <alexandre.vicenzi@suse.com>
|
||||
|
||||
- extend README.md
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 25 10:04:26 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user