-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple example of starting a process in Java 17
- Loading branch information
0 parents
commit 3e5f6a7
Showing
5 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Local build | ||
**/out/ | ||
|
||
# Git | ||
/.git/ | ||
.gitignore | ||
|
||
# IntelliJ | ||
/.idea/ | ||
|
||
# macOS | ||
**/.DS_Store | ||
|
||
# GitHub | ||
/.github/ | ||
|
||
# Docker | ||
Dockerfile | ||
.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Multi Arch Docker Build | ||
|
||
on: | ||
push: | ||
|
||
env: | ||
DOCKER_BUILDKIT: 1 | ||
BUILDKIT_PROGRESS: plain | ||
PROGRESS_NO_TRUNC: 1 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Allow us to build multi-arch images | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@master | ||
with: | ||
platforms: all | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@master | ||
|
||
- name: Do the build | ||
run: docker buildx build --platform linux/arm64/v8,linux/amd64 . |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# syntax=docker/dockerfile:1.3.0-labs | ||
FROM eclipse-temurin:17.0.2_8-jdk-focal as builder | ||
|
||
COPY ProcessUser.java . | ||
RUN javac ProcessUser.java | ||
RUN java ProcessUser > /tmp/output.txt | ||
|
||
FROM scratch | ||
COPY --from=builder /tmp/output.txt . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import java.io.IOException; | ||
|
||
public class ProcessUser { | ||
public static void main(String[] args) throws IOException, InterruptedException { | ||
new ProcessBuilder("uname", "-a") | ||
.inheritIO() | ||
.start() | ||
.waitFor(); | ||
} | ||
} |