-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (29 loc) · 964 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (29 loc) · 964 Bytes
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
FROM debian:bullseye-slim
ARG BAZELISK_VERSION=v1.20.0
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
file \
git \
gnupg \
openjdk-17-jdk-headless \
python3 \
unzip \
zip \
build-essential \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL -o /usr/local/bin/bazel \
"https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-linux-amd64" \
&& chmod +x /usr/local/bin/bazel \
&& ln -s /usr/local/bin/bazel /usr/local/bin/bazelisk
RUN groupadd -g 10001 bazel \
&& useradd -m -u 10001 -g bazel -s /bin/bash bazel \
&& mkdir -p /workspace /home/bazel/.cache/bazelisk \
&& chown -R bazel:bazel /workspace /home/bazel
ENV HOME=/home/bazel
ENV BAZELISK_HOME=/home/bazel/.cache/bazelisk
WORKDIR /workspace
USER bazel
CMD ["bazel", "--version"]