-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstackrox-build.Dockerfile
More file actions
99 lines (89 loc) · 3.23 KB
/
stackrox-build.Dockerfile
File metadata and controls
99 lines (89 loc) · 3.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Provides the tooling required to run StackRox dockerized build targets.
FROM registry.access.redhat.com/ubi8:latest
ARG TARGETARCH
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN touch /i-am-rox-ci-image
RUN dnf update -y && \
dnf install -y \
dnf-plugins-core \
wget \
&& \
dnf config-manager --set-enabled ubi-8-codeready-builder-rpms && \
dnf update -y && \
wget --quiet -O - https://rpm.nodesource.com/setup_lts.x | bash - && \
wget --quiet -O - https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \
dnf update -y && \
# This set replaces centos:stream8 "Development Tools". It is possible
# rox-ci-image does not need all of these.
dnf install -y \
autoconf \
automake \
binutils \
gcc \
gcc-c++ \
gdb \
glibc-devel \
libtool \
make \
pkgconf \
pkgconf-m4 \
pkgconf-pkg-config \
redhat-rpm-config \
rpm-build \
strace \
ctags \
git \
perl-Fedora-VSP \
perl-generators \
source-highlight && \
dnf install -y \
bzip2-devel \
gettext \
git-core \
jq \
zstd \
lz4-devel \
nodejs \
procps-ng \
yarn \
zlib-devel \
&& \
dnf upgrade -y && \
dnf clean all && \
rm -rf /var/cache/dnf /var/cache/yum
ARG GOLANG_VERSION=1.24.4
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
RUN set -e; case "$TARGETARCH" in \
"amd64" ) GOLANG_SHA256="77e5da33bb72aeaef1ba4418b6fe511bc4d041873cbf82e5aa6318740df98717";; \
"arm64") GOLANG_SHA256="d5501ee5aca0f258d5fe9bfaed401958445014495dc115f202d43d5210b45241";; \
*) echo "Unsupported $TARGETARCH"; exit 1;; \
esac && \
wget --no-verbose -O go.tgz "https://dl.google.com/go/go${GOLANG_VERSION}.linux-${TARGETARCH}.tar.gz" && \
echo "${GOLANG_SHA256} *go.tgz" | sha256sum -c - && \
tar -C /usr/local -xzf go.tgz && \
rm go.tgz && \
mkdir -p "$GOPATH/src" "$GOPATH/bin" && \
chmod -R 777 "$GOPATH"
ARG FETCH_VERSION=0.4.6
RUN set -e; case "$TARGETARCH" in \
"amd64" ) FETCH_SHA256="a67ed3141d6deb7e7841f40505cba11eb7a37abbab78374712a42373e7854209";; \
"arm64") FETCH_SHA256="4b9115a1f1a90c7088bff9ffc7d2de3547ef1d21709528e878af09a4c348dea3";; \
*) echo "Unsupported $TARGETARCH"; exit 1;; \
esac && \
wget --no-verbose -O fetch https://github.com/gruntwork-io/fetch/releases/download/v${FETCH_VERSION}/fetch_linux_${TARGETARCH} && \
echo "${FETCH_SHA256} fetch" | sha256sum -c - && \
install fetch /usr/bin && \
rm fetch
ARG OSSLS_VERSION=0.11.1
RUN set -e; case "$TARGETARCH" in \
"amd64" ) OSSLS_SHA256="f1bf3012961c1d90ba307a46263f29025028d35c209b9a65e5c7d502c470c95f";; \
*) echo "Unsupported $TARGETARCH, skipping."; exit 0;; \
esac && \
fetch --repo="https://github.com/stackrox/ossls" --tag="${OSSLS_VERSION}" --release-asset="ossls_linux_amd64" . && \
echo "${OSSLS_SHA256} *ossls_linux_amd64" | sha256sum -c - && \
install ossls_linux_amd64 /usr/bin/ossls && \
rm ossls_linux_amd64 && \
ossls version
ENV CGO_ENABLED=1
WORKDIR /go/src/github.com/stackrox/rox