diff options
author | Sebastiaan van Stijn <thaJeztah@users.noreply.github.com> | 2019-03-21 01:48:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-21 01:48:27 +0100 |
commit | 8ad6dcf2a5964b6f95fd141d554378d6cf82a1c2 (patch) | |
tree | a2f64b0a81cf9113907bfd37546ab9c3f2966441 /image | |
parent | 2ceaaa50fd6eac48b80527650638cbae778f867c (diff) | |
parent | 3429e9993085520ac902fef2ef6aabd57080bd36 (diff) | |
download | docker-8ad6dcf2a5964b6f95fd141d554378d6cf82a1c2.tar.gz |
Merge pull request #38888 from quasilyte/fix_copying
image: do actual RootFS.DiffIDs copying in Clone()
Diffstat (limited to 'image')
-rw-r--r-- | image/rootfs.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/image/rootfs.go b/image/rootfs.go index 84843e10c6..f73a0660fa 100644 --- a/image/rootfs.go +++ b/image/rootfs.go @@ -38,7 +38,8 @@ func (r *RootFS) Append(id layer.DiffID) { func (r *RootFS) Clone() *RootFS { newRoot := NewRootFS() newRoot.Type = r.Type - newRoot.DiffIDs = append(r.DiffIDs) + newRoot.DiffIDs = make([]layer.DiffID, len(r.DiffIDs)) + copy(newRoot.DiffIDs, r.DiffIDs) return newRoot } |