From eaa83e1db3ac764460a23033f8cdf759d8723668 Mon Sep 17 00:00:00 2001 From: Noureddine Date: Mon, 4 Nov 2024 20:15:25 +0000 Subject: [PATCH] distroless tools container --- .wordlist.txt | 1 + misc/bin/build | 5 +++++ misc/distroless_tools/Dockerfile | 10 ++++++++++ misc/distroless_tools/readme.md | 9 +++++++++ 4 files changed, 25 insertions(+) create mode 100644 misc/distroless_tools/Dockerfile create mode 100644 misc/distroless_tools/readme.md diff --git a/.wordlist.txt b/.wordlist.txt index 866317a845..e22e9b545b 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -35,6 +35,7 @@ deterministically dev Dev directionality +distroless DNS Dockerized dockerized diff --git a/misc/bin/build b/misc/bin/build index e69de29bb2..10370219de 100755 --- a/misc/bin/build +++ b/misc/bin/build @@ -0,0 +1,5 @@ +FROM gcr.io/distroless/java17-debian12 +COPY validator/build/libs/ /app/ +COPY schema /app/schema +WORKDIR /app +CMD ["validator-1.0-SNAPSHOT-all.jar"] \ No newline at end of file diff --git a/misc/distroless_tools/Dockerfile b/misc/distroless_tools/Dockerfile new file mode 100644 index 0000000000..241934aa74 --- /dev/null +++ b/misc/distroless_tools/Dockerfile @@ -0,0 +1,10 @@ +FROM openjdk:17-jdk-slim AS build-env +COPY . /app/ +WORKDIR /app +RUN /app/validator/bin/build + +FROM gcr.io/distroless/java17-debian12 +WORKDIR /app +COPY --from=build-env /app/validator/build/libs/ /app/ +COPY gencode/java/udmi/schema /app/schema +CMD ["validator-1.0-SNAPSHOT-all.jar"] diff --git a/misc/distroless_tools/readme.md b/misc/distroless_tools/readme.md new file mode 100644 index 0000000000..50644595b8 --- /dev/null +++ b/misc/distroless_tools/readme.md @@ -0,0 +1,9 @@ +# Distroless Tools + +This directory builds the UDMI tooling (validator) using [distroless containers](https://github.com/GoogleContainerTools/distroless) + +## Usage + +```shell +$ misc/distroless_tools/build [PUSH_REf] +```