cache: include os/arch in cache checksum

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-18.09
Tonis Tiigi 2017-10-15 19:04:53 +02:00
parent 7171f5a27d
commit 914ea2110b
1 changed files with 9 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"path"
"runtime"
"sort"
"strings"
@ -38,9 +39,13 @@ func (e *execOp) CacheKey(ctx context.Context) (digest.Digest, error) {
dt, err := json.Marshal(struct {
Type string
Exec *pb.ExecOp
OS string
Arch string
}{
Type: execCacheType,
Exec: e.op,
OS: runtime.GOOS,
Arch: runtime.GOARCH,
})
if err != nil {
return "", err
@ -175,9 +180,13 @@ func (e *execOp) ContentMask(ctx context.Context) (digest.Digest, [][]string, er
dt, err := json.Marshal(struct {
Type string
Exec *pb.ExecOp
OS string
Arch string
}{
Type: execCacheType,
Exec: &ecopy,
OS: runtime.GOOS,
Arch: runtime.GOARCH,
})
if err != nil {
return "", nil, err