-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (43 loc) · 2.23 KB
/
Dockerfile
File metadata and controls
52 lines (43 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# This Dockerfile expects build artifacts in the build-output/ directory.
# Targets:
# - base = UBI image with ksml user and build packages from microdnf
# - graal = base stage plus GraalVM installed
# - ksml = base plus GraalVM and pre-built artifacts from build-output/
# Step 1: Create the common base image with the ksml user and group and the required packages
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7-1775623882 AS base
ENV LANG=en_US.UTF-8
# Environment variable for Connect Build and Runtime
ENV PATH=/opt/graal/bin:$PATH \
KSML_HOME="/home/ksml" \
KSML_INSTALL="/opt/ksml"
RUN set -eux \
&& microdnf upgrade -y --nodocs \
&& microdnf install -y --nodocs procps tar unzip gzip zlib openssl-devel gcc gcc-c++ \
make patch glibc-langpack-en libxcrypt shadow-utils \
&& useradd -g 0 -u 1024 -d "$KSML_HOME" -ms /bin/sh -f -1 ksml \
&& chown -R ksml:0 "$KSML_HOME" /opt \
&& chmod -R g=u /home /opt
# Step 2: Download and install GraalVM on top of the base image of step 1
FROM base AS graal
ARG TARGETARCH
ADD graalvm-${TARGETARCH}.tar.gz /opt
RUN set -eux \
&& ls -hal /opt \
&& mv /opt/graal* /opt/graal
# Step 3: Use the base image and copy GraalVM from Step 2 and pre-built artifacts from build-output/
FROM base AS ksml
LABEL io.axual.ksml.authors="maintainer@axual.io"
ENV JAVA_HOME=/opt/graalvm
COPY --chown=ksml:0 --from=graal /opt/graal/ /opt/graal/
WORKDIR /home/ksml
USER 1024
# Copy pre-built artifacts from GitHub Actions (expected in build-output/ directory)
COPY --chown=ksml:0 build-output/NOTICE.txt /licenses/THIRD-PARTY-LICENSES.txt
COPY --chown=ksml:0 build-output/LICENSE.txt /licenses/LICENSE.txt
COPY --chown=ksml:0 build-output/libs/ /opt/ksml/libs/
COPY --chown=ksml:0 build-output/ksml-runner*.jar /opt/ksml/ksml.jar
COPY --chown=ksml:0 build-output/ksml-test-runner*.jar /opt/ksml/ksml-test.jar
# Default entrypoint runs the KSML pipeline runner.
# To run the test runner instead, override the entrypoint:
# docker run --entrypoint java <image> -Djava.security.manager=allow -jar /opt/ksml/ksml-test.jar /tests/my-test.yaml
ENTRYPOINT ["java", "-Djava.security.manager=allow", "-jar", "/opt/ksml/ksml.jar"]