blob: 5f5895cb193fd1621a46f79ef984d406c172ac73 [file] [log] [blame]
Lorenz Brunc452a8d2020-04-20 14:09:39 +02001FROM fedora:32
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 \
8 lld \
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +02009 libuuid-devel \
10 python3 \
11 nasm \
12 acpica-tools \
13 gettext-devel \
14 autoconf \
15 bison \
16 libtool \
17 automake \
18 flex \
19 glibc-static \
20 elfutils-libelf-devel \
21 libblkid-devel \
22 lz4 \
23 bc \
24 hostname \
25 which \
26 swtpm-tools \
27 rsync \
Hendrik Hofstadt3e6018f2019-10-28 21:29:42 +010028 qemu-system-x86-core \
Leopold Schabela4516f92019-12-04 20:27:05 +000029 expect \
30 grpc-cli \
Serge Bazanski7a1b10c2020-02-11 10:02:21 +010031 nc \
Lorenz Brunfd166512020-04-01 17:29:45 +020032 python-unversioned-command \
curiousleo070ec4e2021-11-01 16:22:10 +010033 openssl-devel
Serge Bazanski5aa494f2021-05-18 18:57:10 +020034
35# Create CI build user. This is not used by scripts/bin/bazel, but instead only
36# used by CI infrastructure to run build agents as.
37# The newly created user will have a UID of 500, and a corresponding CI group
38# of GID 500 will be created as well. This UID:GID pair's numeric values are
39# relied on by the CI infrastructure and must not change without coordination.
40RUN set -e -x ;\
41 useradd -u 500 -U -m -d /home/ci ci
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020042
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020043# Install Bazel binary
44RUN curl -o /usr/local/bin/bazel \
Lorenz Brun2073ce32021-02-03 18:52:59 +010045 https://releases.bazel.build/4.0.0/release/bazel-4.0.0-linux-x86_64 && \
46 echo '7bee349a626281fc8b8d04a7a0b0358492712377400ab12533aeb39c2eb2b901 /usr/local/bin/bazel' | sha256sum --check && \
Lorenz Brunc452a8d2020-04-20 14:09:39 +020047 chmod +x /usr/local/bin/bazel
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020048
49# Use a shared Go module cache for gazelle
50# https://github.com/bazelbuild/bazel-gazelle/pull/535
51ENV GO_REPOSITORY_USE_HOST_CACHE=1
52
Serge Bazanskie7bb94c2021-07-02 17:11:58 +020053# Install ibazel (bazel-watcher)
54RUN set -e -x ;\
55 cd /tmp ;\
56 git clone -b v0.15.10 https://github.com/bazelbuild/bazel-watcher ;\
57 cd bazel-watcher ;\
58 [ $(git rev-parse HEAD) == "84cab6f15f64850fb972ea88701e634c8b611301" ] ;\
59 bazel --output_user_root /tmp/bazel-watcher-cache build //ibazel ;\
60 cp bazel-bin/ibazel/linux_amd64_stripped/ibazel /usr/local/bin/ibazel ;\
61 cd /tmp ;\
62 rm -rf bazel-watcher bazel-watcher-cache
63
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020064# --userns=keep-id uses the workdir as $HOME otherwise
65RUN mkdir /user
66ENV HOME=/user
67
68WORKDIR /work