1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- FROM gcr.io/gcp-runtimes/ubuntu_18_0_4 AS parent
15+ FROM gcr.io/gcp-runtimes/ubuntu_20_0_4 AS parent
1616
1717ARG cnb_uid=1000
1818ARG cnb_gid=1000
@@ -21,18 +21,18 @@ ARG stack_id="google"
2121# Required by python/runtime.
2222RUN apt-get update && apt-get install -y --no-install-recommends \
2323 libexpat1 \
24- libffi6 \
24+ libffi7 \
2525 libmpdec2 \
2626 && apt-get clean && rm -rf /var/lib/apt/lists/*
2727
2828# Required by dotnet/runtime.
2929RUN apt-get update && apt-get install -y --no-install-recommends \
30- libicu60 \
30+ libicu66 \
3131 && apt-get clean && rm -rf /var/lib/apt/lists/*
3232
3333# Required by cpp/runtime.
3434RUN apt-get update \
35- && apt-get install -y libc++1-9 \
35+ && apt-get install -y libc++1-10 libc++abi1-10 \
3636 && apt-get clean && rm -rf /var/lib/apt/lists/*
3737
3838LABEL io.buildpacks.stack.id=${stack_id}
@@ -53,10 +53,8 @@ USER cnb
5353FROM parent AS gcf-cpp-incremental-0
5454RUN apt-get update \
5555 && apt install -y --no-install-recommends \
56- build-essential g++-8 gcc-8 git libstdc++-8-dev pkg-config python3 tar unzip zip \
56+ build-essential git pkg-config python3 tar unzip zip \
5757 && apt-get clean && rm -rf /var/lib/apt/lists/*
58- RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100 \
59- && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 100
6058
6159# Install cmake, ninja and vcpkg. The first two are build systems for C++, the
6260# latter is the package manager we use. In an open source builder these would
@@ -65,15 +63,20 @@ RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100 \
6563FROM gcf-cpp-incremental-0 AS gcf-cpp-incremental-1
6664
6765WORKDIR /usr/local
68- RUN curl -sSL https://github.com/Kitware/CMake/releases/download/v3.19.4/cmake-3.19.4-Linux-x86_64.tar.gz | \
66+ # Depending on the version of vcpkg, vcpkg may or may not prefer newer versions
67+ # of cmake and will try to download it for every build_example. Instead, make
68+ # sure we have already installed a suitable version of cmake.
69+ RUN curl -sSL https://github.com/Kitware/CMake/releases/download/v3.29.8/cmake-3.29.8-Linux-x86_64.tar.gz | \
6970 tar -xzf - --strip-components=1
7071
7172RUN curl -sSL https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip | \
7273 funzip >/usr/local/bin/ninja && \
7374 chmod 755 /usr/local/bin/ninja
7475
7576WORKDIR /usr/local/vcpkg
76- RUN curl -sSL https://github.com/Microsoft/vcpkg/archive/2023.06.20.tar.gz | \
77+ # This version of vcpkg should match the version in ci/pack/buildpack/bin/build
78+ # otherwise the contents of the vcpkg cache may not be used.
79+ RUN curl -sSL https://github.com/Microsoft/vcpkg/archive/2024.09.30.tar.gz | \
7780 tar -xzf - --strip-components=1 && \
7881 ./bootstrap-vcpkg.sh -disableMetrics -useSystemBinaries && \
7982 rm -fr toolsrc/build.rel downloads/*
@@ -141,6 +144,9 @@ FROM gcf-cpp-incremental-2 AS gcf-cpp-ci-0
141144COPY . /usr/local/share/gcf
142145RUN find /usr/local/share/gcf -type f | xargs chmod 644
143146RUN find /usr/local/share/gcf -type d | xargs chmod 755
147+ # More recent versions of cmake error when attempting to run `configure_file` on
148+ # files owned by root. Changing the owner to user cnb fixes this.
149+ RUN chown -R cnb:cnb /usr/local/share/gcf
144150RUN VCPKG_OVERLAY_PORTS=/usr/local/share/gcf/build_scripts/vcpkg-overlays \
145151 /usr/local/vcpkg/vcpkg install --feature-flags=-manifests --triplet x64-linux-nodebug functions-framework-cpp
146152
0 commit comments