-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathDockerfile.ubi
More file actions
51 lines (43 loc) · 1.59 KB
/
Copy pathDockerfile.ubi
File metadata and controls
51 lines (43 loc) · 1.59 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
# syntax = docker/dockerfile:experimental
# Interim container so we can copy pulumi binaries
# Must be defined first
FROM redhat/ubi9-minimal:latest as builder
ARG PULUMI_VERSION
RUN microdnf upgrade -y && microdnf install -y \
git \
tar \
unzip
# Install the Pulumi SDK, including the CLI and language runtimes.
RUN curl -fsSL https://get.pulumi.com/ | bash -s -- --version $PULUMI_VERSION
# The runtime container
FROM redhat/ubi9-minimal:latest
LABEL org.opencontainers.image.description="Pulumi CLI container for Java"
WORKDIR /pulumi/projects
ENV MAVEN_VERSION 3.9.10
ENV GRADLE_VERSION 8.14.2
RUN microdnf upgrade -y && microdnf install -y \
git \
tar \
java-21-openjdk-devel \
unzip \
zip \
findutils \
ca-certificates \
tzdata-java \
&& microdnf clean all && [ ! -d /var/cache/yum ] || rm -rf /var/cache/yum
RUN curl -fsSL "https://get.sdkman.io" | bash \
&& bash -c ". /root/.sdkman/bin/sdkman-init.sh \
&& sdk install maven ${MAVEN_VERSION} \
&& sdk install gradle ${GRADLE_VERSION} \
&& sdk flush archives \
&& sdk flush temp \
"
# Uses the workdir, copies from pulumi interim container
COPY --from=builder /root/.pulumi/bin/pulumi /pulumi/bin/pulumi
COPY --from=builder /root/.pulumi/bin/*-java* /pulumi/bin/
COPY --from=builder /root/.pulumi/bin/pulumi-analyzer-policy /pulumi/bin/
ENV PATH="/pulumi/bin:/root/.sdkman/candidates/maven/current/bin:/root/.sdkman/candidates/gradle/current/bin:${PATH}" \
JAVA_HOME="/usr/lib/jvm/jre-21-openjdk" \
JAVA_VENDOR="openjdk" \
JAVA_VERSION="21"
CMD ["pulumi"]