mirror of
https://github.com/google/cpu_features.git
synced 2025-07-01 21:31:15 +02:00
ci: add bazel docker for amd64 and arm64
This commit is contained in:
37
bazel/ci/docker/Dockerfile
Normal file
37
bazel/ci/docker/Dockerfile
Normal file
@ -0,0 +1,37 @@
|
||||
# Create a virtual environment with all tools installed
|
||||
# ref: https://hub.docker.com/_/ubuntu
|
||||
FROM ubuntu:latest AS env
|
||||
|
||||
# Install system build dependencies
|
||||
ENV PATH=/usr/local/bin:$PATH
|
||||
RUN apt-get update -qq \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \
|
||||
git wget build-essential \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
ENTRYPOINT ["/usr/bin/bash", "-c"]
|
||||
CMD ["/usr/bin/bash"]
|
||||
|
||||
# Install Bazelisk
|
||||
ARG PLATFORM
|
||||
RUN wget \
|
||||
"https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-${PLATFORM}" \
|
||||
&& chmod +x "bazelisk-linux-${PLATFORM}" \
|
||||
&& mv "bazelisk-linux-${PLATFORM}" /usr/local/bin/bazel
|
||||
|
||||
FROM env AS devel
|
||||
WORKDIR /home/project
|
||||
COPY . .
|
||||
|
||||
FROM devel AS build
|
||||
RUN bazel version
|
||||
RUN bazel build \
|
||||
-c opt \
|
||||
--subcommands=true \
|
||||
...
|
||||
|
||||
FROM build AS test
|
||||
RUN bazel test \
|
||||
-c opt \
|
||||
--test_output=errors \
|
||||
...
|
Reference in New Issue
Block a user