Index: src/github.com/docker/docker/pkg/archive/archive_unix.go --- src/github.com/docker/docker/pkg/archive/archive_unix.go.orig 2020-07-11 09:41:31.000000000 +0200 +++ src/github.com/docker/docker/pkg/archive/archive_unix.go 2020-07-11 09:46:08.772079000 +0200 @@ -63,7 +63,7 @@ s, ok := stat.(*syscall.Stat_t) if ok { - inode = s.Ino + inode = uint64(s.Ino) } return Index: src/github.com/docker/docker/pkg/archive/changes_unix.go --- src/github.com/docker/docker/pkg/archive/changes_unix.go.orig 2020-07-11 09:41:31.000000000 +0200 +++ src/github.com/docker/docker/pkg/archive/changes_unix.go 2020-07-11 09:46:08.772210000 +0200 @@ -35,7 +35,7 @@ } func getIno(fi os.FileInfo) uint64 { - return fi.Sys().(*syscall.Stat_t).Ino + return uint64(fi.Sys().(*syscall.Stat_t).Ino) } func hasHardlinks(fi os.FileInfo) bool { Index: src/github.com/docker/docker/pkg/system/mknod.go --- src/github.com/docker/docker/pkg/system/mknod.go.orig 2020-07-11 09:41:31.000000000 +0200 +++ src/github.com/docker/docker/pkg/system/mknod.go 2020-07-11 09:46:08.772336000 +0200 @@ -9,7 +9,7 @@ // Mknod creates a filesystem node (file, device special file or named pipe) named path // with attributes specified by mode and dev. func Mknod(path string, mode uint32, dev int) error { - return unix.Mknod(path, mode, dev) + return unix.Mknod(path, mode, uint64(dev)) } // Mkdev is used to build the value of linux devices (in /dev/) which specifies major Index: src/github.com/docker/docker/vendor/github.com/moby/sys/mountinfo/mountinfo.go --- src/github.com/docker/docker/vendor/github.com/moby/sys/mountinfo/mountinfo.go.orig 2020-07-11 09:41:32.000000000 +0200 +++ src/github.com/docker/docker/vendor/github.com/moby/sys/mountinfo/mountinfo.go 2020-07-11 09:47:07.985719000 +0200 @@ -1,21 +1,11 @@ package mountinfo -import "io" - // GetMounts retrieves a list of mounts for the current running process, // with an optional filter applied (use nil for no filter). func GetMounts(f FilterFunc) ([]*Info, error) { return parseMountTable(f) } -// GetMountsFromReader retrieves a list of mounts from the -// reader provided, with an optional filter applied (use nil -// for no filter). This can be useful in tests or benchmarks -// that provide a fake mountinfo data. -func GetMountsFromReader(reader io.Reader, f FilterFunc) ([]*Info, error) { - return parseInfoFile(reader, f) -} - // Mounted determines if a specified mountpoint has been mounted. // On Linux it looks at /proc/self/mountinfo. func Mounted(mountpoint string) (bool, error) { Index: src/github.com/jwilder/docker-gen/template.go --- src/github.com/jwilder/docker-gen/template.go.orig 2020-07-11 09:40:58.000000000 +0200 +++ src/github.com/jwilder/docker-gen/template.go 2020-07-11 09:46:08.772506000 +0200 @@ -16,6 +16,7 @@ "regexp" "strconv" "strings" + "sort" "syscall" "text/template" ) @@ -409,6 +410,30 @@ return strings.TrimSpace(s) } +// sortStrings returns a sorted array of strings +func sortStrings(values []string) []string { + sort.Strings(values) + return values +} + +// sortObjects returns a sorted array of objects (sorted by object key field) +func sortObjects(objs interface{}, key string) (interface{}, error) { + objsVal, err := getArrayValues("sortObj", objs) + if err != nil { + return nil, err + } + data := make([]interface{}, objsVal.Len()) + for i := 0; i < objsVal.Len(); i++ { + data[i] = objsVal.Index(i).Interface() + } + sort.Slice(data, func(i, j int) bool { + a := reflect.ValueOf(deepGet(data[i], key)).Interface().(string) + b := reflect.ValueOf(deepGet(data[j], key)).Interface().(string) + return a < b + }) + return data, nil +} + // when returns the trueValue when the condition is true and the falseValue otherwise func when(condition bool, trueValue, falseValue interface{}) interface{} { if condition { @@ -447,6 +472,8 @@ "trimPrefix": trimPrefix, "trimSuffix": trimSuffix, "trim": trim, + "sortStrings": sortStrings, + "sortObjects": sortObjects, "when": when, "where": where, "whereNot": whereNot,