Skip to content

Commit

Permalink
Merge branch 'master' into alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
wagoodman authored Nov 9, 2019
2 parents 0edf35e + bfcfc54 commit 168e67c
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 718 deletions.
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ release:

builds:
- binary: dive
env:
- CGO_ENABLED=0
goos:
- windows
- darwin
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
FROM alpine:3.10
COPY --from=wagoodman/dive:dev /usr/local/bin/docker /usr/local/bin/

ARG DOCKER_CLI_VERSION=19.03.1
RUN wget -O- https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_CLI_VERSION}.tgz | \
tar -xzf - docker/docker --strip-component=1 && \
mv docker /usr/local/bin

COPY dive /usr/local/bin/
RUN apk add -U --no-cache gpgme device-mapper

ENTRYPOINT ["/usr/local/bin/dive"]
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ run-large: build
$(BUILD_PATH) amir20/clashleaders:latest

run-podman: build
$(BUILD_PATH) localhost/dive-example:latest --source podman

run-podman-build: build
podman build -t dive-example:latest -f .data/Dockerfile.example .
$(BUILD_PATH) localhost/dive-example:latest --engine podman
$(BUILD_PATH) localhost/dive-example:latest --source podman


run-podman-large: build
$(BUILD_PATH) docker.io/amir20/clashleaders:latest --engine podman
$(BUILD_PATH) docker.io/amir20/clashleaders:latest --source podman

run-ci: build
CI=true $(BUILD_PATH) dive-example:latest --ci-config .data/.dive-ci
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ With valid `source` options as such:

**Ubuntu/Debian**
```bash
wget https://github.com/wagoodman/dive/releases/download/v0.9.0/dive_0.9.0_linux_amd64.deb
sudo apt install ./dive_0.9.0_linux_amd64.deb
wget https://github.com/wagoodman/dive/releases/download/v0.9.1/dive_0.9.1_linux_amd64.deb
sudo apt install ./dive_0.9.1_linux_amd64.deb
```

**RHEL/Centos**
```bash
curl -OL https://github.com/wagoodman/dive/releases/download/v0.9.0/dive_0.9.0_linux_amd64.rpm
rpm -i dive_0.9.0_linux_amd64.rpm
curl -OL https://github.com/wagoodman/dive/releases/download/v0.9.1/dive_0.9.1_linux_amd64.rpm
rpm -i dive_0.9.1_linux_amd64.rpm
```

**Arch Linux**
Expand All @@ -108,11 +108,11 @@ The above example assumes [`yay`](https://aur.archlinux.org/packages/yay/) as th
brew install dive
```

or download the latest Darwin build from the [releases page](https://github.com/wagoodman/dive/releases/download/v0.9.0/dive_0.9.0_darwin_amd64.tar.gz).
or download the latest Darwin build from the [releases page](https://github.com/wagoodman/dive/releases/download/v0.9.1/dive_0.9.1_darwin_amd64.tar.gz).

**Windows**

Download the [latest release](https://github.com/wagoodman/dive/releases/download/v0.9.0/dive_0.9.0_windows_amd64.zip).
Download the [latest release](https://github.com/wagoodman/dive/releases/download/v0.9.1/dive_0.9.1_windows_amd64.zip).

**Go tools**
Requires Go version 1.9 or higher.
Expand Down
20 changes: 20 additions & 0 deletions dive/image/podman/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package podman
import (
"fmt"
"github.com/wagoodman/dive/utils"
"io"
"os"
"os/exec"
)
Expand All @@ -27,6 +28,25 @@ func runPodmanCmd(cmdStr string, args ...string) error {
return cmd.Run()
}

func streamPodmanCmd(args ...string) (error, io.Reader) {
if !isPodmanClientBinaryAvailable() {
return fmt.Errorf("cannot find podman client executable"), nil
}

cmd := exec.Command("podman", utils.CleanArgs(args)...)
cmd.Env = os.Environ()

reader, writer, err := os.Pipe()
if err != nil {
return err, nil
}

cmd.Stdout = writer
cmd.Stderr = os.Stderr

return cmd.Start(), reader
}

func isPodmanClientBinaryAvailable() bool {
_, err := exec.LookPath("podman")
return err == nil
Expand Down
128 changes: 0 additions & 128 deletions dive/image/podman/image_directory.go

This file was deleted.

78 changes: 0 additions & 78 deletions dive/image/podman/layer.go

This file was deleted.

Loading

0 comments on commit 168e67c

Please sign in to comment.