refactor!: migrate Go module from wagoodman/dive to joschi/dive (#36)

* refactor!: migrate Go module from wagoodman/dive to joschi/dive
* fix: bring back :latest Docker image
This commit is contained in:
Jochen Schalanda 2024-11-07 09:17:34 +01:00 committed by GitHub
commit e46f931a8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 115 additions and 120 deletions

View file

@ -50,6 +50,7 @@ dockers:
- dive
dockerfile: Dockerfile
image_templates:
- '{{ envOrDefault "REGISTRY" "docker.io" }}/joschi/dive:latest'
- '{{ envOrDefault "REGISTRY" "docker.io" }}/joschi/dive:{{ .Version }}'
build_flag_templates:
- "--build-arg=DOCKER_CLI_VERSION={{.Env.DOCKER_CLI_VERSION}}"

View file

@ -16,7 +16,7 @@ DOCKER_CLI_VERSION = 27.3.1
# Command templates #################################
LINT_CMD = $(TEMP_DIR)/golangci-lint run --tests=false --timeout=2m --config .golangci.yaml
GOIMPORTS_CMD = $(TEMP_DIR)/gosimports -local github.com/wagoodman
GOIMPORTS_CMD = $(TEMP_DIR)/gosimports -local github.com/joschi
RELEASE_CMD = DOCKER_CLI_VERSION=$(DOCKER_CLI_VERSION) $(TEMP_DIR)/goreleaser release --clean
SNAPSHOT_CMD = $(RELEASE_CMD) --skip=publish --skip=sign --snapshot
CHRONICLE_CMD = $(TEMP_DIR)/chronicle
@ -186,7 +186,7 @@ ci-test-docker-image:
--rm \
-t \
-v /var/run/docker.sock:/var/run/docker.sock \
'${PRODUCTION_REGISTRY}/wagoodman/dive:latest' \
'${PRODUCTION_REGISTRY}/joschi/dive:latest' \
'${TEST_IMAGE}' \
--ci

View file

@ -1,11 +1,11 @@
# dive
[![GitHub release](https://img.shields.io/github/release/wagoodman/dive.svg)](https://github.com/wagoodman/dive/releases/latest)
[![Validations](https://github.com/wagoodman/dive/actions/workflows/validations.yaml/badge.svg)](https://github.com/wagoodman/dive/actions/workflows/validations.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/wagoodman/dive)](https://goreportcard.com/report/github.com/wagoodman/dive)
[![License: MIT](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](https://github.com/wagoodman/dive/blob/main/LICENSE)
[![GitHub release](https://img.shields.io/github/release/joschi/dive.svg)](https://github.com/joschi/dive/releases/latest)
[![Validations](https://github.com/joschi/dive/actions/workflows/validations.yaml/badge.svg)](https://github.com/joschi/dive/actions/workflows/validations.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/joschi/dive)](https://goreportcard.com/report/github.com/joschi/dive)
[![License: MIT](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](https://github.com/joschi/dive/blob/main/LICENSE)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg?style=flat)](https://www.paypal.me/wagoodman)
**A tool for exploring a docker image, layer contents, and discovering ways to shrink the size of your Docker/OCI image.**
**A tool for exploring a Docker image, layer contents, and discovering ways to shrink the size of your Docker/OCI image.**
![Image](.data/demo.gif)
@ -15,9 +15,9 @@ To analyze a Docker image simply run dive with an image tag/id/digest:
dive <your-image-tag>
```
or you can dive with docker command directly
or you can dive with Docker directly:
```
alias dive="docker run -ti --rm -v /var/run/docker.sock:/var/run/docker.sock wagoodman/dive"
alias dive="docker run -ti --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/joschi/dive"
dive <your-image-tag>
# for example
@ -29,7 +29,7 @@ or if you want to build your image then jump straight into analyzing it:
dive build -t <some-tag> .
```
Building on Macbook (supporting only the Docker container engine)
Building on macOS (supporting only the Docker container engine):
```bash
docker run --rm -it \
@ -37,7 +37,7 @@ docker run --rm -it \
-v "$(pwd)":"$(pwd)" \
-w "$(pwd)" \
-v "$HOME/.dive.yaml":"$HOME/.dive.yaml" \
wagoodman/dive:latest build -t <some-tag> .
ghcr.io/joschi/dive:latest build -t <some-tag> .
```
Additionally you can run this in your CI pipeline to ensure you're keeping wasted space to a minimum (this skips the UI):
@ -97,8 +97,8 @@ With valid `source` options as such:
Using debs:
```bash
DIVE_VERSION=$(curl -sL "https://api.github.com/repos/wagoodman/dive/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
curl -fOL "https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.deb"
DIVE_VERSION=$(curl -sL "https://api.github.com/repos/joschi/dive/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
curl -fOL "https://github.com/joschi/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.deb"
sudo apt install ./dive_${DIVE_VERSION}_linux_amd64.deb
```
@ -113,13 +113,13 @@ sudo snap connect dive:docker-daemon docker:docker-daemon
> [!CAUTION]
> The Snap method is not recommended if you installed Docker via `apt-get`, since it might break your existing Docker daemon.
>
> See also: https://github.com/wagoodman/dive/issues/546
> See also: https://github.com/joschi/dive/issues/546
**RHEL/Centos**
```bash
DIVE_VERSION=$(curl -sL "https://api.github.com/repos/wagoodman/dive/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
curl -fOL "https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.rpm"
DIVE_VERSION=$(curl -sL "https://api.github.com/repos/joschi/dive/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
curl -fOL "https://github.com/joschi/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.rpm"
rpm -i dive_${DIVE_VERSION}_linux_amd64.rpm
```
@ -145,7 +145,7 @@ If you use [MacPorts](https://www.macports.org):
sudo port install dive
```
Or download the latest Darwin build from the [releases page](https://github.com/wagoodman/dive/releases/latest).
Or download the latest Darwin build from the [releases page](https://github.com/joschi/dive/releases/latest).
**Windows**
@ -167,13 +167,13 @@ If you use [winget](https://learn.microsoft.com/en-gb/windows/package-manager/):
winget install --id wagoodman.dive
```
Or download the latest Windows build from the [releases page](https://github.com/wagoodman/dive/releases/latest).
Or download the latest Windows build from the [releases page](https://github.com/joschi/dive/releases/latest).
**Go tools**
Requires Go version 1.10 or higher.
```bash
go install github.com/wagoodman/dive@latest
go install github.com/joschi/dive@latest
```
*Note*: installing in this way you will not see a proper version when running `dive -v`.
@ -190,27 +190,21 @@ nix-env -iA nixpkgs.dive
**Docker**
```bash
docker pull wagoodman/dive
docker pull ghcr.io/joschi/dive
```
or
```bash
docker pull quay.io/wagoodman/dive
```
When running you'll need to include the docker socket file:
When running you'll need to include the Docker socket file:
```bash
docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
wagoodman/dive:latest <dive arguments...>
ghcr.io/joschi/dive:latest <dive arguments...>
```
Docker for Windows (showing PowerShell compatible line breaks; collapse to a single line for Command Prompt compatibility)
```bash
docker run --rm -it `
-v /var/run/docker.sock:/var/run/docker.sock `
wagoodman/dive:latest <dive arguments...>
ghcr.io/joschi/dive:latest <dive arguments...>
```
**Note:** depending on the version of docker you are running locally you may need to specify the docker API version as an environment variable:
@ -222,7 +216,7 @@ or if you are running with a docker image:
docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
-e DOCKER_API_VERSION=1.37 \
wagoodman/dive:latest <dive arguments...>
ghcr.io/joschi/dive:latest <dive arguments...>
```
## CI Integration

View file

@ -16,7 +16,7 @@ If a release is found to be problematic, it can be retracted with the following
- Deleting the GitHub Release
- Untag the docker images in the `docker.io` registry
- Revert the brew formula in [`wagoodman/homebrew-dive`](https://github.com/wagoodman/homebrew-dive) to point to the previous release
- Revert the brew formula in [`joschi/homebrew-dive`](https://github.com/joschi/homebrew-dive) to point to the previous release
- Add a new `retract` entry in the go.mod for the versioned release
**Note**: do not delete release tags from the git repository since there may already be references to the release

View file

@ -8,8 +8,8 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/wagoodman/dive/dive"
"github.com/wagoodman/dive/runtime"
"github.com/joschi/dive/dive"
"github.com/joschi/dive/runtime"
)
// doAnalyzeCmd takes a docker image tag, digest, or id and displays the

View file

@ -4,8 +4,8 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/wagoodman/dive/dive"
"github.com/wagoodman/dive/runtime"
"github.com/joschi/dive/dive"
"github.com/joschi/dive/runtime"
)
// buildCmd represents the build command

View file

@ -12,8 +12,8 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/wagoodman/dive/dive"
"github.com/wagoodman/dive/dive/filetree"
"github.com/joschi/dive/dive"
"github.com/joschi/dive/dive/filetree"
)
var cfgFile string

View file

@ -4,9 +4,9 @@ import (
"fmt"
"strings"
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/dive/image/docker"
"github.com/wagoodman/dive/dive/image/podman"
"github.com/joschi/dive/dive/image"
"github.com/joschi/dive/dive/image/docker"
"github.com/joschi/dive/dive/image/podman"
)
const (

View file

@ -1,7 +1,7 @@
package image
import (
"github.com/wagoodman/dive/dive/filetree"
"github.com/joschi/dive/dive/filetree"
)
type Analyzer interface {

View file

@ -4,7 +4,7 @@ import (
"fmt"
"os"
"github.com/wagoodman/dive/dive/image"
"github.com/joschi/dive/dive/image"
)
type archiveResolver struct{}

View file

@ -5,7 +5,7 @@ import (
"os"
"os/exec"
"github.com/wagoodman/dive/utils"
"github.com/joschi/dive/utils"
)
// runDockerCmd runs a given Docker command in the current tty

View file

@ -14,7 +14,7 @@ import (
"github.com/docker/docker/client"
"golang.org/x/net/context"
"github.com/wagoodman/dive/dive/image"
"github.com/joschi/dive/dive/image"
)
type engineResolver struct{}

View file

@ -12,8 +12,8 @@ import (
"path/filepath"
"strings"
"github.com/wagoodman/dive/dive/filetree"
"github.com/wagoodman/dive/dive/image"
"github.com/joschi/dive/dive/filetree"
"github.com/joschi/dive/dive/image"
)
type ImageArchive struct {

View file

@ -3,8 +3,8 @@ package docker
import (
"strings"
"github.com/wagoodman/dive/dive/filetree"
"github.com/wagoodman/dive/dive/image"
"github.com/joschi/dive/dive/filetree"
"github.com/joschi/dive/dive/image"
)
// Layer represents a Docker image layer and metadata

View file

@ -4,7 +4,7 @@ import (
"os"
"testing"
"github.com/wagoodman/dive/dive/image"
"github.com/joschi/dive/dive/image"
)
func TestLoadArchive(tarPath string) (*ImageArchive, error) {

View file

@ -1,7 +1,7 @@
package image
import (
"github.com/wagoodman/dive/dive/filetree"
"github.com/joschi/dive/dive/filetree"
)
type Image struct {

View file

@ -6,7 +6,7 @@ import (
"github.com/dustin/go-humanize"
"github.com/wagoodman/dive/dive/filetree"
"github.com/joschi/dive/dive/filetree"
)
const (

View file

@ -9,7 +9,7 @@ import (
"os"
"os/exec"
"github.com/wagoodman/dive/utils"
"github.com/joschi/dive/utils"
)
// runPodmanCmd runs a given Podman command in the current tty

View file

@ -7,8 +7,8 @@ import (
"fmt"
"io"
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/dive/image/docker"
"github.com/joschi/dive/dive/image"
"github.com/joschi/dive/dive/image/docker"
)
type resolver struct{}

View file

@ -6,7 +6,7 @@ package podman
import (
"fmt"
"github.com/wagoodman/dive/dive/image"
"github.com/joschi/dive/dive/image"
)
type resolver struct{}

2
go.mod
View file

@ -1,4 +1,4 @@
module github.com/wagoodman/dive
module github.com/joschi/dive
go 1.23

View file

@ -21,7 +21,7 @@
package main
import (
"github.com/wagoodman/dive/cmd"
"github.com/joschi/dive/cmd"
)
var (

View file

@ -10,8 +10,8 @@ import (
"github.com/logrusorgru/aurora/v4"
"github.com/spf13/viper"
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/utils"
"github.com/joschi/dive/dive/image"
"github.com/joschi/dive/utils"
)
type CiEvaluator struct {

View file

@ -6,7 +6,7 @@ import (
"github.com/spf13/viper"
"github.com/wagoodman/dive/dive/image/docker"
"github.com/joschi/dive/dive/image/docker"
)
func Test_Evaluator(t *testing.T) {

View file

@ -8,7 +8,7 @@ import (
"github.com/logrusorgru/aurora/v4"
"github.com/spf13/viper"
"github.com/wagoodman/dive/dive/image"
"github.com/joschi/dive/dive/image"
)
const (

View file

@ -5,8 +5,8 @@ import (
"github.com/sirupsen/logrus"
"github.com/wagoodman/dive/dive/filetree"
diveImage "github.com/wagoodman/dive/dive/image"
"github.com/joschi/dive/dive/filetree"
diveImage "github.com/joschi/dive/dive/image"
)
type export struct {

View file

@ -5,7 +5,7 @@ import (
"github.com/sergi/go-diff/diffmatchpatch"
"github.com/wagoodman/dive/dive/image/docker"
"github.com/joschi/dive/dive/image/docker"
)
func Test_Export(t *testing.T) {

View file

@ -1,7 +1,7 @@
package export
import (
"github.com/wagoodman/dive/dive/filetree"
"github.com/joschi/dive/dive/filetree"
)
type layer struct {

View file

@ -3,7 +3,7 @@ package runtime
import (
"github.com/spf13/viper"
"github.com/wagoodman/dive/dive"
"github.com/joschi/dive/dive"
)
type Options struct {

View file

@ -9,13 +9,13 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/afero"
"github.com/wagoodman/dive/dive"
"github.com/wagoodman/dive/dive/filetree"
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/runtime/ci"
"github.com/wagoodman/dive/runtime/export"
"github.com/wagoodman/dive/runtime/ui"
"github.com/wagoodman/dive/utils"
"github.com/joschi/dive/dive"
"github.com/joschi/dive/dive/filetree"
"github.com/joschi/dive/dive/image"
"github.com/joschi/dive/runtime/ci"
"github.com/joschi/dive/runtime/export"
"github.com/joschi/dive/runtime/ui"
"github.com/joschi/dive/utils"
)
func run(enableUi bool, options Options, imageResolver image.Resolver, events eventChannel, filesystem afero.Fs) {

View file

@ -9,9 +9,9 @@ import (
"github.com/spf13/afero"
"github.com/spf13/viper"
"github.com/wagoodman/dive/dive"
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/dive/image/docker"
"github.com/joschi/dive/dive"
"github.com/joschi/dive/dive/image"
"github.com/joschi/dive/dive/image/docker"
)
type defaultResolver struct{}

View file

@ -6,11 +6,11 @@ import (
"github.com/awesome-gocui/gocui"
"github.com/sirupsen/logrus"
"github.com/wagoodman/dive/dive/filetree"
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/runtime/ui/key"
"github.com/wagoodman/dive/runtime/ui/layout"
"github.com/wagoodman/dive/runtime/ui/layout/compound"
"github.com/joschi/dive/dive/filetree"
"github.com/joschi/dive/dive/image"
"github.com/joschi/dive/runtime/ui/key"
"github.com/joschi/dive/runtime/ui/layout"
"github.com/joschi/dive/runtime/ui/layout/compound"
)
const debug = false

View file

@ -6,10 +6,10 @@ import (
"github.com/awesome-gocui/gocui"
"github.com/sirupsen/logrus"
"github.com/wagoodman/dive/dive/filetree"
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/runtime/ui/view"
"github.com/wagoodman/dive/runtime/ui/viewmodel"
"github.com/joschi/dive/dive/filetree"
"github.com/joschi/dive/dive/image"
"github.com/joschi/dive/runtime/ui/view"
"github.com/joschi/dive/runtime/ui/viewmodel"
)
type Controller struct {

View file

@ -8,7 +8,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/wagoodman/dive/runtime/ui/format"
"github.com/joschi/dive/runtime/ui/format"
)
type BindingInfo struct {

View file

@ -4,8 +4,8 @@ import (
"github.com/awesome-gocui/gocui"
"github.com/sirupsen/logrus"
"github.com/wagoodman/dive/runtime/ui/view"
"github.com/wagoodman/dive/utils"
"github.com/joschi/dive/runtime/ui/view"
"github.com/joschi/dive/utils"
)
type LayerDetailsCompoundLayout struct {

View file

@ -6,8 +6,8 @@ import (
"github.com/awesome-gocui/gocui"
"github.com/sirupsen/logrus"
"github.com/wagoodman/dive/runtime/ui/format"
"github.com/wagoodman/dive/utils"
"github.com/joschi/dive/runtime/ui/format"
"github.com/joschi/dive/utils"
)
// Debug is just for me :)

View file

@ -8,11 +8,11 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/wagoodman/dive/dive/filetree"
"github.com/wagoodman/dive/runtime/ui/format"
"github.com/wagoodman/dive/runtime/ui/key"
"github.com/wagoodman/dive/runtime/ui/viewmodel"
"github.com/wagoodman/dive/utils"
"github.com/joschi/dive/dive/filetree"
"github.com/joschi/dive/runtime/ui/format"
"github.com/joschi/dive/runtime/ui/key"
"github.com/joschi/dive/runtime/ui/viewmodel"
"github.com/joschi/dive/utils"
)
type ViewOptionChangeListener func() error

View file

@ -7,8 +7,8 @@ import (
"github.com/awesome-gocui/gocui"
"github.com/sirupsen/logrus"
"github.com/wagoodman/dive/runtime/ui/format"
"github.com/wagoodman/dive/utils"
"github.com/joschi/dive/runtime/ui/format"
"github.com/joschi/dive/utils"
)
type FilterEditListener func(string) error

View file

@ -9,9 +9,9 @@ import (
"github.com/dustin/go-humanize"
"github.com/sirupsen/logrus"
"github.com/wagoodman/dive/dive/filetree"
"github.com/wagoodman/dive/runtime/ui/format"
"github.com/wagoodman/dive/runtime/ui/key"
"github.com/joschi/dive/dive/filetree"
"github.com/joschi/dive/runtime/ui/format"
"github.com/joschi/dive/runtime/ui/key"
)
type ImageDetails struct {

View file

@ -7,10 +7,10 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/runtime/ui/format"
"github.com/wagoodman/dive/runtime/ui/key"
"github.com/wagoodman/dive/runtime/ui/viewmodel"
"github.com/joschi/dive/dive/image"
"github.com/joschi/dive/runtime/ui/format"
"github.com/joschi/dive/runtime/ui/key"
"github.com/joschi/dive/runtime/ui/viewmodel"
)
// Layer holds the UI objects and data models for populating the lower-left pane.

View file

@ -1,5 +1,5 @@
package view
import "github.com/wagoodman/dive/runtime/ui/viewmodel"
import "github.com/joschi/dive/runtime/ui/viewmodel"
type LayerChangeListener func(viewmodel.LayerSelection) error

View file

@ -8,9 +8,9 @@ import (
"github.com/dustin/go-humanize"
"github.com/sirupsen/logrus"
"github.com/wagoodman/dive/dive/image"
"github.com/wagoodman/dive/runtime/ui/format"
"github.com/wagoodman/dive/runtime/ui/key"
"github.com/joschi/dive/dive/image"
"github.com/joschi/dive/runtime/ui/format"
"github.com/joschi/dive/runtime/ui/key"
)
type LayerDetails struct {

View file

@ -7,9 +7,9 @@ import (
"github.com/awesome-gocui/gocui"
"github.com/sirupsen/logrus"
"github.com/wagoodman/dive/runtime/ui/format"
"github.com/wagoodman/dive/runtime/ui/key"
"github.com/wagoodman/dive/utils"
"github.com/joschi/dive/runtime/ui/format"
"github.com/joschi/dive/runtime/ui/key"
"github.com/joschi/dive/utils"
)
// Status holds the UI objects and data models for populating the bottom-most pane. Specifically the panel

View file

@ -3,8 +3,8 @@ package view
import (
"github.com/awesome-gocui/gocui"
"github.com/wagoodman/dive/dive/filetree"
"github.com/wagoodman/dive/dive/image"
"github.com/joschi/dive/dive/filetree"
"github.com/joschi/dive/dive/image"
)
type IView interface {

View file

@ -10,8 +10,8 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/wagoodman/dive/dive/filetree"
"github.com/wagoodman/dive/runtime/ui/format"
"github.com/joschi/dive/dive/filetree"
"github.com/joschi/dive/runtime/ui/format"
)
// FileTreeViewModel holds the UI objects and data models for populating the right pane. Specifically the pane that

View file

@ -10,9 +10,9 @@ import (
"github.com/fatih/color"
"github.com/sergi/go-diff/diffmatchpatch"
"github.com/wagoodman/dive/dive/filetree"
"github.com/wagoodman/dive/dive/image/docker"
"github.com/wagoodman/dive/runtime/ui/format"
"github.com/joschi/dive/dive/filetree"
"github.com/joschi/dive/dive/image/docker"
"github.com/joschi/dive/runtime/ui/format"
)
const allowTestDataCapture = false

View file

@ -1,7 +1,7 @@
package viewmodel
import (
"github.com/wagoodman/dive/dive/image"
"github.com/joschi/dive/dive/image"
)
type LayerSelection struct {

View file

@ -1,6 +1,6 @@
package viewmodel
import "github.com/wagoodman/dive/dive/image"
import "github.com/joschi/dive/dive/image"
type LayerSetState struct {
LayerIndex int