2023-04-13 08:23:59 -04:00
|
|
|
# syntax=docker/dockerfile:1.5-labs
|
2023-06-15 10:50:35 -04:00
|
|
|
FROM fedora:38
|
2023-04-13 08:23:59 -04:00
|
|
|
|
|
|
|
ARG TARGETOS
|
|
|
|
ARG TARGETARCH
|
2023-11-09 14:17:14 -05:00
|
|
|
ARG BAZEL_VERSION=6.4.0
|
2023-04-13 08:23:59 -04:00
|
|
|
ARG BAZELISK_VERSION=v1.16.0
|
|
|
|
ARG BAZELISK_SHA256=168851e70cf5f95c0e215e7f3aaca5132ffc3c8dd8f585a4157b0be2b53cfe32
|
|
|
|
|
|
|
|
ADD --checksum=sha256:${BAZELISK_SHA256} \
|
|
|
|
https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-${TARGETOS}-${TARGETARCH} \
|
|
|
|
/usr/local/bin/bazelisk
|
|
|
|
|
|
|
|
RUN chmod +x /usr/local/bin/bazelisk && \
|
2023-06-15 10:50:35 -04:00
|
|
|
ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel && \
|
|
|
|
dnf install -y \
|
|
|
|
git \
|
|
|
|
diffutils \
|
|
|
|
libxcrypt-compat \
|
|
|
|
python3 \
|
|
|
|
&& \
|
|
|
|
dnf clean all && \
|
|
|
|
groupadd --gid 1000 builder && \
|
|
|
|
useradd -rm -d /home/builder -s /bin/bash -g root -u 1000 --gid builder builder && \
|
|
|
|
mkdir -p /home/builder/.cache && \
|
|
|
|
mkdir -p /workspace && \
|
|
|
|
chown -R builder:builder /home/builder/.cache /workspace && \
|
|
|
|
git config --global --add safe.directory /workspace
|
2023-04-13 08:23:59 -04:00
|
|
|
|
|
|
|
USER builder
|
|
|
|
WORKDIR /workspace
|
|
|
|
|
|
|
|
RUN git config --global --add safe.directory /workspace && \
|
|
|
|
USE_BAZEL_VERSION=${BAZEL_VERSION} bazel version
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/usr/local/bin/bazel" ]
|