-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile.jdk
More file actions
40 lines (31 loc) · 1.25 KB
/
Dockerfile.jdk
File metadata and controls
40 lines (31 loc) · 1.25 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
# Stage 1: Buildx
FROM docker/buildx-bin:0.33.0 AS buildx
# Stage 2: Node.js
FROM node:20.11.0 AS node
# Final Stage: Base image with DinD runner
FROM summerwind/actions-runner-dind:v2.333.0-ubuntu-24.04
# Set JDK_VERSION for later stages
ARG JDK_VERSION=17
# Switch to root user for installation
USER root
# Install required packages Azure CLI, and AWS CLI
RUN apt-get update && apt-get install -y --no-install-recommends \
wget make build-essential unzip mandoc less \
openjdk-${JDK_VERSION}-jdk maven \
&& curl -sL https://aka.ms/InstallAzureCLIDeb | bash \
&& curl -sL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
&& unzip awscliv2.zip \
&& ./aws/install \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* awscliv2.zip ./aws
# Copy Buildx binary from the Buildx stage
COPY --from=buildx /buildx /usr/libexec/docker/cli-plugins/docker-buildx
# Copy settings.xml and set permissions
COPY settings.xml /home/runner/.m2/settings.xml
RUN chown runner:runner -R /home/runner/.m2
# Switch back to runner user
USER runner
# Copy Node.js files from the Node stage
COPY --from=node /usr/local/lib /usr/local/lib
COPY --from=node /usr/local/include /usr/local/include
COPY --from=node /usr/local/bin /usr/local/bin