I am trying to understand how vcpkg can integrate with docker caching mechanism.
Here is my first naive attempt:
% cat Dockerfile
[...]
RUN vcpkg.exe install libpng # neat caching to prevent (re)compilation
WORKDIR c:/app
COPY . . # anything after this line will be (re)compiled
RUN cmake -S . -B build
My app contains a vcpkg.json file:
{
"name": "my-proj",
"version": "0.1.0",
"dependencies": [
{
"name": "libpng"
},
[...]
The line vcpkg.exe install libpng
is a nice trick since upon the next run, docker will directly re-use the cache and will not redo the complete libpng rebuild.
Now my question is what if I need to vcpkg install
a private dependency ? For example a public or private project that is not listed on the main vcpkg registry ?
Per documentation I cannot specify an alternate registry (vcpkg-configuration.json
):
Is there another simple solution to build a dependency and cache it so that it is not re-build on the cmake -S . -B build
line ?