title | description | author | ms.author | ms.date | ms.topic | zone_pivot_group_filename | zone_pivot_groups |
---|---|---|---|---|---|---|---|
Tutorial: Set up a vcpkg asset cache |
Learn to set up a local asset cache to mirror download assets. |
vicroms |
viromer |
01/10/2024 |
tutorial |
zone-pivot-groups.json |
shell-selections |
All asset caches are configured through the X_VCPKG_ASSET_SOURCES
environment variable. The value
of X_VCPKG_ASSET_SOURCES
follows a specific configuration
syntax.
In this tutorial you'll learn how to:
[!div class="checklist"]
- A terminal
- vcpkg
You can use the Azure Blob Storage backend "x-azurl
", to store
assets. Alternatively, you can use a filesystem directories to store
your download assets, including network locations. To do so, you need to use the
file://
protocol in your asset cache URL.
In this tutorial, you'll create a local asset cache location to store downloaded artifacts. If you have an Azure DevOps Blob Storage you want to use instead, replace the URL and provide a SAS token as the second parameter in the configuration string.
- Create a directory to serve as an asset cache location (substitute with any locations of your choosing):
::: zone pivot="shell-powershell, shell-cmd"
mkdir D:\vcpkg\asset-cache
::: zone-end ::: zone pivot="shell-bash"
mkdir /home/vcpkg/asset-cache
::: zone-end
Next set the value of X_VCPKG_ASSET_SOURCES
as follows:
::: zone pivot="shell-powershell"
$env:X_VCPKG_ASSET_SOURCES="clear;x-azurl,file://D:/vcpkg/asset-cache,,readwrite"
::: zone-end ::: zone pivot="shell-cmd"
set X_VCPKG_ASSET_SOURCES="clear;x-azurl,file://D:/vcpkg/asset-cache,,readwrite"
::: zone-end
::: zone pivot="shell-cmd, shell-powershell"
This X_VCPKG_ASSET_SOURCES
configuration adds the following source strings:
clear
, disables any previously configured asset cachex-azurl,file://C:/vcpkg/asset-cache,,readwrite
, sets a filesystem asset cache, located inD:\vcpkg\asset-cache
, with read-write permissions. ::: zone-end
::: zone pivot="shell-bash"
export X_VCPKG_ASSET_SOURCES="clear;x-azurl,file:///home/vcpkg/asset-cache,,readwrite"
This X_VCPKG_ASSET_SOURCES
configuration adds the following source strings:
clear
, disables any previously configured asset cachex-azurl,file:///home/vcpkg/asset-cache,,readwrite
, sets a filesystem asset cache, located inhome/vcpkg/asset-cache
, with read-write permissions.
::: zone-end
Here are other tasks to try next: