Integrate github.com/docker/libkv
Note that this package will ultimately go away; this is just an intermediate step towards that; see

- https://github.com/moby/swarmkit/pull/3130
- https://github.com/moby/moby/pull/45348


A reduced set of the dependency, only taking the parts that are used. Taken from
upstream commit: https://github.com/docker/libkv/commit/dfacc563de57ee17ca54bb3b6b2a004454f3ce41

    # install filter-repo (https://github.com/newren/git-filter-repo/blob/main/INSTALL.md)
    brew install git-filter-repo
    
    cd ~/projects
    
    # create a temporary clone of docker
    git clone https://github.com/docker/libkv.git temp_libkv
    cd temp_libkv
    
    # create branch to work with
    git checkout -b migrate_libkv
    
    # remove all code, except for the files we need; rename the remaining ones to their new target location
    git filter-repo --force \
        --path libkv.go \
        --path store/store.go \
        --path store/boltdb/boltdb.go \
        --path-rename libkv.go:libnetwork/internal/kvstore/kvstore_manage.go \
        --path-rename store/store.go:libnetwork/internal/kvstore/kvstore.go \
        --path-rename store/boltdb/:libnetwork/internal/kvstore/boltdb/
    
    
    # go to the target github.com/moby/moby repository
    cd ~/projects/docker
    
    # create a branch to work with
    git checkout -b integrate_libkv
    
    # add the temporary repository as an upstream and make sure it's up-to-date
    git remote add temp_libkv ~/projects/temp_libkv
    git fetch temp_libkv
    
    # merge the upstream code, rewriting "pkg/symlink" to "symlink"
    git merge --allow-unrelated-histories --signoff -S temp_libkv/migrate_libkv


See individual commits for details


**- What I did**

**- How I did it**

**- How to verify it**

**- Description for the changelog**
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->


**- A picture of a cute animal (not mandatory but encouraged)**


.github/workflows/.dco.yml
# reusable workflow
name: .dco

# TODO: hide reusable workflow from the UI. Tracked in https://github.com/community/community/discussions/12025

on:
  workflow_call:

env:
  ALPINE_VERSION: 3.16

jobs:
  run:
    runs-on: ubuntu-20.04
    steps:
      -
        name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      -
        name: Dump context
        uses: actions/github-script@v6
        with:
          script: |
            console.log(JSON.stringify(context, null, 2));
      -
        name: Get base ref
        id: base-ref
        uses: actions/github-script@v6
        with:
          result-encoding: string
          script: |
            if (/^refs\/pull\//.test(context.ref) && context.payload?.pull_request?.base?.ref != undefined) {
              return context.payload.pull_request.base.ref;
            }
            return context.ref.replace(/^refs\/heads\//g, '');
      -
        name: Validate
        run: |
          docker run --rm \
            -v "$(pwd):/workspace" \
            -e VALIDATE_REPO \
            -e VALIDATE_BRANCH \
            alpine:${{ env.ALPINE_VERSION }} sh -c 'apk add --no-cache -q bash git openssh-client && git config --system --add safe.directory /workspace && cd /workspace && hack/validate/dco'
        env:
          VALIDATE_REPO: ${{ github.server_url }}/${{ github.repository }}.git
          VALIDATE_BRANCH: ${{ steps.base-ref.outputs.result }}

# reusable workflow
name: .dco

# TODO: hide reusable workflow from the UI. Tracked in https://github.com/community/community/discussions/12025

on:
  workflow_call:

env:
  ALPINE_VERSION: 3.16

jobs:
  run:
    runs-on: ubuntu-20.04
    steps:
      -
        name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      -
        name: Dump context
        uses: actions/github-script@v6
        with:
          script: |
            console.log(JSON.stringify(context, null, 2));
      -
        name: Get base ref
        id: base-ref
        uses: actions/github-script@v6
        with:
          result-encoding: string
          script: |
            if (/^refs\/pull\//.test(context.ref) && context.payload?.pull_request?.base?.ref != undefined) {
              return context.payload.pull_request.base.ref;
            }
            return context.ref.replace(/^refs\/heads\//g, '');
#      -
#        name: Validate
#        run: |
#          docker run --rm \
#            -v "$(pwd):/workspace" \
#            -e VALIDATE_REPO \
#            -e VALIDATE_BRANCH \
#            alpine:${{ env.ALPINE_VERSION }} sh -c 'apk add --no-cache -q bash git openssh-client && git config --system --add safe.directory /workspace && cd /workspace && hack/validate/dco'
#        env:
#          VALIDATE_REPO: ${{ github.server_url }}/${{ github.repository }}.git
#          VALIDATE_BRANCH: ${{ steps.base-ref.outputs.result }}

- opened https://github.com/moby/moby/pull/45820 to re-enable it