blob: 4272dd675f0f23b77103d4c859c4e47fdc34144d [file] [log] [blame]
Lorenz Brun942f5e22022-01-27 15:03:10 +01001FROM fedora:35
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +02002
3RUN dnf -y upgrade && \
Lorenz Brunfd166512020-04-01 17:29:45 +02004 dnf -y install \
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +02005 "@Development Tools" \
6 g++ \
Lorenz Brun605efbe2021-09-28 14:01:01 +02007 llvm \
Lorenz Brun942f5e22022-01-27 15:03:10 +01008 clang \
Lorenz Brun605efbe2021-09-28 14:01:01 +02009 lld \
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020010 libuuid-devel \
11 python3 \
12 nasm \
13 acpica-tools \
14 gettext-devel \
15 autoconf \
16 bison \
17 libtool \
18 automake \
19 flex \
20 glibc-static \
21 elfutils-libelf-devel \
22 libblkid-devel \
23 lz4 \
24 bc \
25 hostname \
26 which \
27 swtpm-tools \
28 rsync \
Hendrik Hofstadt3e6018f2019-10-28 21:29:42 +010029 qemu-system-x86-core \
Leopold Schabela4516f92019-12-04 20:27:05 +000030 expect \
31 grpc-cli \
Serge Bazanski7a1b10c2020-02-11 10:02:21 +010032 nc \
Lorenz Brunfd166512020-04-01 17:29:45 +020033 python-unversioned-command \
Leopold Schabeld32d1ea2021-11-02 00:06:07 +010034 openssl-devel \
35 java-11-openjdk-headless
36
37
38# (java-11-openjdk-headless is required for the Jenkins CI agent)
39
Serge Bazanski5aa494f2021-05-18 18:57:10 +020040
41# Create CI build user. This is not used by scripts/bin/bazel, but instead only
42# used by CI infrastructure to run build agents as.
43# The newly created user will have a UID of 500, and a corresponding CI group
44# of GID 500 will be created as well. This UID:GID pair's numeric values are
45# relied on by the CI infrastructure and must not change without coordination.
46RUN set -e -x ;\
47 useradd -u 500 -U -m -d /home/ci ci
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020048
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020049# Install Bazel binary
50RUN curl -o /usr/local/bin/bazel \
Lorenz Brun8fda0842021-11-09 19:47:51 +010051 https://releases.bazel.build/4.2.0/release/bazel-4.2.0-linux-x86_64 && \
52 echo '643f3cdc707fc27dad3e5eb4f97ed7fa8f2a132a5477fb4ac2eae3c52d7abb65 /usr/local/bin/bazel' | sha256sum --check && \
Lorenz Brunc452a8d2020-04-20 14:09:39 +020053 chmod +x /usr/local/bin/bazel
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020054
55# Use a shared Go module cache for gazelle
56# https://github.com/bazelbuild/bazel-gazelle/pull/535
57ENV GO_REPOSITORY_USE_HOST_CACHE=1
58
Serge Bazanskie7bb94c2021-07-02 17:11:58 +020059# Install ibazel (bazel-watcher)
60RUN set -e -x ;\
61 cd /tmp ;\
62 git clone -b v0.15.10 https://github.com/bazelbuild/bazel-watcher ;\
63 cd bazel-watcher ;\
64 [ $(git rev-parse HEAD) == "84cab6f15f64850fb972ea88701e634c8b611301" ] ;\
65 bazel --output_user_root /tmp/bazel-watcher-cache build //ibazel ;\
66 cp bazel-bin/ibazel/linux_amd64_stripped/ibazel /usr/local/bin/ibazel ;\
67 cd /tmp ;\
68 rm -rf bazel-watcher bazel-watcher-cache
69
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020070# --userns=keep-id uses the workdir as $HOME otherwise
71RUN mkdir /user
72ENV HOME=/user
73
74WORKDIR /work