aboutsummaryrefslogtreecommitdiff
path: root/ci/docker/amd64/Dockerfile
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 05:07:50 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 05:07:50 +0000
commit565f9ec7b3645e58e22192fb7692c31721032599 (patch)
tree69f578706d7adc704ef6026d51ba239aa31ce2b1 /ci/docker/amd64/Dockerfile
parent5c6ee50d0151c0ff50f9998118d722fe3d0890b0 (diff)
parent6d28abb49625745335bfa37dc3d0e704b21cd5f3 (diff)
downloadcpu_features-android14-mainline-sdkext-release.tar.gz
Change-Id: I73801ac945f166520b8b332734154a8771c55441
Diffstat (limited to 'ci/docker/amd64/Dockerfile')
-rw-r--r--ci/docker/amd64/Dockerfile48
1 files changed, 48 insertions, 0 deletions
diff --git a/ci/docker/amd64/Dockerfile b/ci/docker/amd64/Dockerfile
new file mode 100644
index 0000000..9b25e28
--- /dev/null
+++ b/ci/docker/amd64/Dockerfile
@@ -0,0 +1,48 @@
+# Create a virtual environment with all tools installed
+# ref: https://hub.docker.com/_/ubuntu
+FROM ubuntu:latest AS env
+LABEL maintainer="corentinl@google.com"
+# Install system build dependencies
+ENV PATH=/usr/local/bin:$PATH
+RUN apt-get update -qq \
+&& DEBIAN_FRONTEND=noninteractive apt-get install -yq git wget libssl-dev build-essential \
+ ninja-build python3 pkgconf libglib2.0-dev \
+&& apt-get clean \
+&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+ENTRYPOINT ["/usr/bin/bash", "-c"]
+CMD ["/usr/bin/bash"]
+
+# Install CMake 3.21.3
+RUN wget "https://cmake.org/files/v3.21/cmake-3.21.3-linux-x86_64.sh" \
+&& chmod a+x cmake-3.21.3-linux-x86_64.sh \
+&& ./cmake-3.21.3-linux-x86_64.sh --prefix=/usr/local/ --skip-license \
+&& rm cmake-3.21.3-linux-x86_64.sh
+
+FROM env AS devel
+WORKDIR /home/project
+COPY . .
+
+FROM devel AS build
+RUN cmake -version
+RUN cmake -S. -Bbuild
+RUN cmake --build build --target all -v
+RUN cmake --build build --target install -v
+
+FROM build AS test
+ENV CTEST_OUTPUT_ON_FAILURE=1
+RUN cmake --build build --target test -v
+
+# Test install rules
+FROM env AS install_env
+COPY --from=build /usr/local /usr/local/
+
+FROM install_env AS install_devel
+WORKDIR /home/sample
+COPY ci/sample .
+
+FROM install_devel AS install_build
+RUN cmake -S. -Bbuild
+RUN cmake --build build --target all -v
+
+FROM install_build AS install_test
+RUN cmake --build build --target test