Skip to content

Commit f5c8ca0

Browse files
committed
feat: add dive bin script
1 parent d6a9a63 commit f5c8ca0

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

bin/dive

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Run Dive as Docker Image
4+
# https://github.com/wagoodman/dive
5+
6+
export DIVE_IMAGE="${DIVE_IMAGE:-"wagoodman/dive"}"
7+
export DIVE_VERSION="${DIVE_VERSION:-"latest"}"
8+
9+
main() {
10+
local OPTS=()
11+
OPTS+=(--rm)
12+
# OPTS+=(-q)
13+
[[ -t 0 ]] && OPTS+=(-it) # terminal
14+
OPTS+=(-v /var/run/docker.sock:/var/run/docker.sock)
15+
OPTS+=(-v "$(pwd):$(pwd)")
16+
OPTS+=(-w "$(pwd)")
17+
# When running dive with the environment variable CI=true then
18+
# the dive UI will be bypassed and will instead analyze your docker image,
19+
# giving it a pass/fail indication via return code.
20+
# https://github.com/wagoodman/dive#ci-integration
21+
[[ "$(whoami)" == "runner" ]] && OPTS+=(-e "CI=true")
22+
# https://github.com/wagoodman/dive#ui-configuration
23+
[[ -r "$HOME/.dive.yaml" ]] && OPTS+=(-v "$HOME/.dive.yaml":"$HOME/.dive.yaml")
24+
docker run "${OPTS[@]}" "${DIVE_IMAGE}:${DIVE_VERSION}" "$@"
25+
}
26+
27+
main "$@"

system/Brewfile.symlink

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ brew "readline" # [Library for command-line editing](https://tiswww.case.edu/php
100100
# brew "awscli" # !!! NO BOTTLE !!! HANGS
101101
# brew "cloud-nuke" # [CLI tool to delete all cloud resources](https://github.com/gruntwork-io/cloud-nuke)
102102
# brew "dependency-check" # !!! REQUIRES XCODE [OWASP dependency-check](https://jeremylong.github.io/DependencyCheck/)
103-
brew "dive" # [Inspection of docker image layers](https://github.com/wagoodman/dive)
103+
# brew "dive" # [Inspection of docker image layers](https://github.com/wagoodman/dive)
104104
brew "docker"
105105
# brew "elixir"
106106
# brew "erlang"

0 commit comments

Comments
 (0)