From 9e2936f9edbb82b8dfca068dc20eda154cc89dc3 Mon Sep 17 00:00:00 2001
From: CrazyMax <crazy-max@users.noreply.github.com>
Date: Sun, 4 Oct 2020 01:10:42 +0200
Subject: [PATCH] Writes cache metadata into the image configuration

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
---
 .github/workflows/ci.yml | 20 ++++++--------------
 UPGRADE.md               |  4 ++--
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f8deddd..5aa1290 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -254,16 +254,12 @@ jobs:
           tags: |
             localhost:5000/name/app:latest
             localhost:5000/name/app:1.0.0
-          cache-from: type=registry,ref=localhost:5000/name/app:cache
-          cache-to: type=registry,ref=localhost:5000/name/app:cache
+          cache-from: type=registry,ref=localhost:5000/name/app
+          cache-to: type=inline
       -
         name: Inspect (1)
         run: |
-          docker buildx imagetools inspect localhost:5000/name/app:1.0.0
-      -
-        name: Inspect cache (1)
-        run: |
-          docker buildx imagetools inspect localhost:5000/name/app:cache
+          docker buildx imagetools inspect localhost:5000/name/app:latest
       -
         name: Image digest (1)
         run: echo ${{ steps.docker_build.outputs.digest }}
@@ -284,16 +280,12 @@ jobs:
           tags: |
             localhost:5000/name/app:latest
             localhost:5000/name/app:1.0.0
-          cache-from: type=registry,ref=localhost:5000/name/app:cache
-          cache-to: type=registry,ref=localhost:5000/name/app:cache
+          cache-from: type=registry,ref=localhost:5000/name/app
+          cache-to: type=inline
       -
         name: Inspect (2)
         run: |
-          docker buildx imagetools inspect localhost:5000/name/app:1.0.0
-      -
-        name: Inspect cache (2)
-        run: |
-          docker buildx imagetools inspect localhost:5000/name/app:cache
+          docker buildx imagetools inspect localhost:5000/name/app:latest
       -
         name: Image digest (2)
         run: echo ${{ steps.docker_build2.outputs.digest }}
diff --git a/UPGRADE.md b/UPGRADE.md
index 72e4ecf..bda8509 100644
--- a/UPGRADE.md
+++ b/UPGRADE.md
@@ -66,8 +66,8 @@ steps:
       pull: true
       push: true
       build-args: arg1=value1,arg2=value2
-      cache-from: type=registry,ref=myorg/myrepository:cache
-      cache-to: type=registry,ref=myorg/myrepository:cache
+      cache-from: type=registry,ref=myorg/myrepository:latest
+      cache-to: type=inline
       tags: myorg/myrepository:latest
 ```