Skip to main content

Tutorial: Set up a kmpkg binary cache using filesystem directories

You are not limited to the default binary cache location as your only local binary cache, it is possible to configure multiple filesystem locations as binary caches. You can even set up specific caches with different permissions, such as read-only, write-only, or read and write permissions.

All binary caches are configured through the KMPKG_BINARY_SOURCES environment variable. The value of KMPKG_BINARY_SOURCES follows a specific configuration syntax.

In this tutorial you'll learn how to:

Prerequisites

  • A terminal
  • kmpkg

1 - Create a binary cache directory

When using the files backend, you can use filesystem directories to store your binary packages, including network locations.

In this tutorial, you'll create two binary cache locations, one with read-write access and a second one with only read access.

Create the two binary cache locations (substitute with any locations of your choosing):

mkdir D:\kmpkg\binary-cache
mkdir \\remote\shared\kmpkg\binary-cache

2 - Configure KMPKG_BINARY_SOURCES

Next set the value of KMPKG_BINARY_SOURCES as follows:

$env:KMPKG_BINARY_SOURCES="clear;files,\\remote\shared\kmpkg\binary-cache,read;files,D:\kmpkg\binary-cache,readwrite"

Next steps

Set up a binary cache using a NuGet feed

Here are other tasks to try next: