Skip to content

Commit

Permalink
Use vcpkg binary caching
Browse files Browse the repository at this point in the history
  • Loading branch information
yaron-zilliqa committed Sep 7, 2023
1 parent 174fac6 commit 8c3d975
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ RUN apt-get update -y \

FROM base AS builder

# CMake 3.24
ARG CMAKE_VERSION=3.24.2
ARG CMAKE_VERSION=3.25.1
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh \
&& echo "739d372726cb23129d57a539ce1432453448816e345e1545f6127296926b6754 cmake-${CMAKE_VERSION}-Linux-x86_64.sh" | sha256sum -c \
&& echo "6598da34f0e3a0f763809e25cfdd646aa1d5e4d133c4277821e63ae5cfe09457 cmake-${CMAKE_VERSION}-Linux-x86_64.sh" | sha256sum -c \
&& mkdir -p "${HOME}"/.local \
&& bash ./cmake-${CMAKE_VERSION}-Linux-x86_64.sh --skip-license --prefix="${HOME}"/.local/ \
&& "${HOME}"/.local/bin/cmake --version \
Expand Down Expand Up @@ -93,7 +92,14 @@ COPY shell.nix .
COPY .ocamlformat .
COPY tests/ tests

# Make sure vcpkg installs brings in the dependencies
RUN apt update -y \
&& apt install -y apt-transport-https ca-certificates gnupg curl \
&& echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - \
&& apt update -y && apt install -y google-cloud-cli

ENV VCPKG_BINARY_SOURCES="default,readwrite;x-gcs,gs://vcpkg/ubuntu/22.04/x64-linux-dynamic/${VCPKG_COMMIT_OR_TAG}/,read"

RUN --mount=type=cache,target=/root/.cache/vcpkg/ ${VCPKG_ROOT}/vcpkg install --triplet=x64-linux-dynamic

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
Expand Down

0 comments on commit 8c3d975

Please sign in to comment.