forked from openshift/hypershift
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.github-actions-runner
More file actions
45 lines (37 loc) · 1.92 KB
/
Copy pathDockerfile.github-actions-runner
File metadata and controls
45 lines (37 loc) · 1.92 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
FROM ghcr.io/actions/actions-runner@sha256:b6614fce332517f74d0a76e7c762fb08e4f2ff13dcf333183397c8a5725b6e8e
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends \
make \
gcc \
libc6-dev \
git \
curl \
ca-certificates \
python3-pip \
skopeo \
&& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg -o /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends gh \
&& rm -rf /var/lib/apt/lists/*
ARG TARGETARCH
ARG GO_VERSION=1.25.7
RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" | tar -C /usr/local -xz
RUN OCP_ARCH=$([ "$TARGETARCH" = "amd64" ] && echo "x86_64" || echo "aarch64") && \
curl -fsSL "https://mirror.openshift.com/pub/openshift-v4/${OCP_ARCH}/clients/ocp/stable/openshift-client-linux.tar.gz" | tar -C /usr/local/bin -xz oc kubectl
ENV PATH="/usr/local/go/bin:${PATH}"
ENV GOPATH="/home/runner/go"
ENV PATH="${GOPATH}/bin:${PATH}"
# Pre-build lint tools (golangci-lint and kube-api-linter plugin)
COPY hack/tools/ /tmp/tools/
RUN cd /tmp/tools && \
mkdir -p /opt/lint-tools && \
GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor go build -tags=tools \
-o /opt/lint-tools/golangci-lint github.com/golangci/golangci-lint/v2/cmd/golangci-lint && \
CGO_ENABLED=1 GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor go build -buildmode=plugin \
-o /opt/lint-tools/kube-api-linter.so sigs.k8s.io/kube-api-linter/pkg/plugin && \
rm -rf /tmp/tools
COPY contrib/ci/gocacheprog/ /tmp/gocacheprog/
RUN cd /tmp/gocacheprog && go build -o /usr/local/bin/gocacheprog . && rm -rf /tmp/gocacheprog
USER runner