From 4f537c865286bcc480c28bdbb22fb5872fec8dee Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Sat, 1 Dec 2018 22:28:52 -0500 Subject: [PATCH 1/6] version bump --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 588ba1e4..52ee1e89 100644 --- a/README.md +++ b/README.md @@ -52,14 +52,14 @@ command. **Ubuntu/Debian** ```bash -wget https://github.com/wagoodman/dive/releases/download/v0.3.0/dive_0.3.0_linux_amd64.deb -sudo apt install ./dive_0.3.0_linux_amd64.deb +wget https://github.com/wagoodman/dive/releases/download/v0.4.0/dive_0.4.0_linux_amd64.deb +sudo apt install ./dive_0.4.0_linux_amd64.deb ``` **RHEL/Centos** ```bash -curl -OL https://github.com/wagoodman/dive/releases/download/v0.3.0/dive_0.3.0_linux_amd64.rpm -rpm -i dive_0.3.0_linux_amd64.rpm +curl -OL https://github.com/wagoodman/dive/releases/download/v0.4.0/dive_0.4.0_linux_amd64.rpm +rpm -i dive_0.4.0_linux_amd64.rpm ``` **Arch Linux** From 06c4a12cff6fc7aac386342a8978db5f3b8d7a16 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Sat, 1 Dec 2018 22:36:10 -0500 Subject: [PATCH 2/6] archive override for windows (zip) --- .goreleaser.yml | 4 ++++ README.md | 3 +++ 2 files changed, 7 insertions(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index 6beada6f..ee4353f6 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -27,6 +27,10 @@ dockers: archive: format: tar.gz + format_overrides: + - goos: windows + format: zip + nfpm: license: MIT maintainer: Alex Goodman diff --git a/README.md b/README.md index 52ee1e89..1aae3560 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,9 @@ brew install dive ``` or download a Darwin build from the releases page. +**Windows** +Download the [latest release](https://github.com/wagoodman/dive/releases/download/v0.4.0/dive_0.4.0_windows_amd64.zip) + **Go tools** ```bash go get github.com/wagoodman/dive From c96c27a3dfb84d0f3f5ec21c7c6f9c0ae5c5d50c Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Sat, 1 Dec 2018 22:39:25 -0500 Subject: [PATCH 3/6] formatting windows title --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1aae3560..43b49444 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ brew install dive or download a Darwin build from the releases page. **Windows** + Download the [latest release](https://github.com/wagoodman/dive/releases/download/v0.4.0/dive_0.4.0_windows_amd64.zip) **Go tools** From 40a30ea369de20390e516653cb7d4394dc76dc42 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Sat, 1 Dec 2018 22:44:27 -0500 Subject: [PATCH 4/6] added mac download link; formatting --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 43b49444..60c01f51 100644 --- a/README.md +++ b/README.md @@ -78,16 +78,17 @@ The above example assumes [`yay`](https://aur.archlinux.org/packages/yay/) as th brew tap wagoodman/dive brew install dive ``` -or download a Darwin build from the releases page. +or download the latest Darwin build from the [releases page](https://github.com/wagoodman/dive/releases/download/v0.4.0/dive_0.4.0_darwin_amd64.tar.gz). **Windows** -Download the [latest release](https://github.com/wagoodman/dive/releases/download/v0.4.0/dive_0.4.0_windows_amd64.zip) +Download the [latest release](https://github.com/wagoodman/dive/releases/download/v0.4.0/dive_0.4.0_windows_amd64.zip). **Go tools** ```bash go get github.com/wagoodman/dive ``` +*Note*: installing in this way you will not see a proper version when running `dive -v`. **Docker** ```bash From fbd2214a511df1dc8efdd6641072cd07c23e6bb5 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Mon, 3 Dec 2018 11:16:19 -0500 Subject: [PATCH 5/6] read entire json file on image parsing --- image/image.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/image/image.go b/image/image.go index 2ceee51c..cd80ffb1 100644 --- a/image/image.go +++ b/image/image.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "strings" "github.com/sirupsen/logrus" @@ -188,8 +189,6 @@ func InitializeData(imageID string) ([]*Layer, []*filetree.FileTree, float64, fi layerProgress := fmt.Sprintf("[layer: %2d]", currentLayer) name := header.Name - var n int - // some layer tars can be relative layer symlinks to other layer tars if header.Typeflag == tar.TypeSymlink || header.Typeflag == tar.TypeReg { @@ -204,9 +203,8 @@ func InitializeData(imageID string) ([]*Layer, []*filetree.FileTree, float64, fi layerReader := tar.NewReader(tarReader) processLayerTar(layerMap, name, layerReader, layerProgress) } else if strings.HasSuffix(name, ".json") { - var fileBuffer = make([]byte, header.Size) - n, err = tarReader.Read(fileBuffer) - if err != nil && err != io.EOF || int64(n) != header.Size { + fileBuffer, err := ioutil.ReadAll(tarReader) + if err != nil { logrus.Panic(err) } jsonFiles[name] = fileBuffer From 910c33fdf0889e925e8b423a6f94ddccd9df5be7 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Mon, 3 Dec 2018 11:16:52 -0500 Subject: [PATCH 6/6] bump patch version in docs --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 60c01f51..2b47b645 100644 --- a/README.md +++ b/README.md @@ -52,14 +52,14 @@ command. **Ubuntu/Debian** ```bash -wget https://github.com/wagoodman/dive/releases/download/v0.4.0/dive_0.4.0_linux_amd64.deb -sudo apt install ./dive_0.4.0_linux_amd64.deb +wget https://github.com/wagoodman/dive/releases/download/v0.4.1/dive_0.4.1_linux_amd64.deb +sudo apt install ./dive_0.4.1_linux_amd64.deb ``` **RHEL/Centos** ```bash -curl -OL https://github.com/wagoodman/dive/releases/download/v0.4.0/dive_0.4.0_linux_amd64.rpm -rpm -i dive_0.4.0_linux_amd64.rpm +curl -OL https://github.com/wagoodman/dive/releases/download/v0.4.1/dive_0.4.1_linux_amd64.rpm +rpm -i dive_0.4.1_linux_amd64.rpm ``` **Arch Linux** @@ -78,11 +78,11 @@ The above example assumes [`yay`](https://aur.archlinux.org/packages/yay/) as th brew tap wagoodman/dive brew install dive ``` -or download the latest Darwin build from the [releases page](https://github.com/wagoodman/dive/releases/download/v0.4.0/dive_0.4.0_darwin_amd64.tar.gz). +or download the latest Darwin build from the [releases page](https://github.com/wagoodman/dive/releases/download/v0.4.1/dive_0.4.1_darwin_amd64.tar.gz). **Windows** -Download the [latest release](https://github.com/wagoodman/dive/releases/download/v0.4.0/dive_0.4.0_windows_amd64.zip). +Download the [latest release](https://github.com/wagoodman/dive/releases/download/v0.4.1/dive_0.4.1_windows_amd64.zip). **Go tools** ```bash