Merge pull request #214 from wagoodman/add-alpine-image
Update alpine based image
This commit is contained in:
commit
943392389c
@ -14,6 +14,19 @@ builds:
|
|||||||
dockers:
|
dockers:
|
||||||
-
|
-
|
||||||
binary: dive
|
binary: dive
|
||||||
|
dockerfile: Dockerfile.slim
|
||||||
|
image_templates:
|
||||||
|
- "wagoodman/dive:{{ .Tag }}-slim"
|
||||||
|
- "wagoodman/dive:v{{ .Major }}-slim"
|
||||||
|
- "wagoodman/dive:v{{ .Major }}.{{ .Minor }}-slim"
|
||||||
|
- "wagoodman/dive:slim"
|
||||||
|
- "quay.io/wagoodman/dive:{{ .Tag }}-slim"
|
||||||
|
- "quay.io/wagoodman/dive:v{{ .Major }}-slim"
|
||||||
|
- "quay.io/wagoodman/dive:v{{ .Major }}.{{ .Minor }}-slim"
|
||||||
|
- "quay.io/wagoodman/dive:slim"
|
||||||
|
-
|
||||||
|
binary: dive
|
||||||
|
dockerfile: Dockerfile
|
||||||
image_templates:
|
image_templates:
|
||||||
- "wagoodman/dive:{{ .Tag }}"
|
- "wagoodman/dive:{{ .Tag }}"
|
||||||
- "wagoodman/dive:v{{ .Major }}"
|
- "wagoodman/dive:v{{ .Major }}"
|
||||||
@ -23,7 +36,18 @@ dockers:
|
|||||||
- "quay.io/wagoodman/dive:v{{ .Major }}"
|
- "quay.io/wagoodman/dive:v{{ .Major }}"
|
||||||
- "quay.io/wagoodman/dive:v{{ .Major }}.{{ .Minor }}"
|
- "quay.io/wagoodman/dive:v{{ .Major }}.{{ .Minor }}"
|
||||||
- "quay.io/wagoodman/dive:latest"
|
- "quay.io/wagoodman/dive:latest"
|
||||||
|
-
|
||||||
|
binary: dive
|
||||||
|
dockerfile: Dockerfile.full
|
||||||
|
image_templates:
|
||||||
|
- "wagoodman/dive:{{ .Tag }}-full"
|
||||||
|
- "wagoodman/dive:v{{ .Major }}-full"
|
||||||
|
- "wagoodman/dive:v{{ .Major }}.{{ .Minor }}-full"
|
||||||
|
- "wagoodman/dive:full"
|
||||||
|
- "quay.io/wagoodman/dive:{{ .Tag }}-full"
|
||||||
|
- "quay.io/wagoodman/dive:v{{ .Major }}-full"
|
||||||
|
- "quay.io/wagoodman/dive:v{{ .Major }}.{{ .Minor }}-full"
|
||||||
|
- "quay.io/wagoodman/dive:full"
|
||||||
archive:
|
archive:
|
||||||
format: tar.gz
|
format: tar.gz
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
FROM alpine:3.9
|
FROM alpine:3.10
|
||||||
COPY dive /
|
COPY dive /
|
||||||
ENTRYPOINT ["/dive"]
|
ENTRYPOINT ["/dive"]
|
||||||
|
15
Dockerfile.full
Normal file
15
Dockerfile.full
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
FROM alpine:3.10
|
||||||
|
|
||||||
|
ARG DOCKER_CLI_VERSION="19.03.1"
|
||||||
|
ENV DOWNLOAD_URL="https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_CLI_VERSION.tgz"
|
||||||
|
|
||||||
|
RUN apk --update add curl \
|
||||||
|
&& mkdir -p /tmp/download \
|
||||||
|
&& curl -L $DOWNLOAD_URL | tar -xz -C /tmp/download \
|
||||||
|
&& mv /tmp/download/docker/docker /usr/local/bin/ \
|
||||||
|
&& rm -rf /tmp/download \
|
||||||
|
&& apk del curl \
|
||||||
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
COPY dive /
|
||||||
|
ENTRYPOINT ["/dive"]
|
3
Dockerfile.slim
Normal file
3
Dockerfile.slim
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM scratch
|
||||||
|
COPY dive /
|
||||||
|
ENTRYPOINT ["/dive"]
|
2
Makefile
2
Makefile
@ -12,7 +12,7 @@ run-large: build
|
|||||||
./build/$(BIN) amir20/clashleaders:latest
|
./build/$(BIN) amir20/clashleaders:latest
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -o build/$(BIN)
|
CGO_ENABLED=0 go build -o build/$(BIN)
|
||||||
|
|
||||||
release: test-coverage validate
|
release: test-coverage validate
|
||||||
./.scripts/tag.sh
|
./.scripts/tag.sh
|
||||||
|
@ -100,6 +100,11 @@ func (image *dockerImageAnalyzer) Fetch() (io.ReadCloser, error) {
|
|||||||
}
|
}
|
||||||
_, _, err = image.client.ImageInspectWithRaw(ctx, image.id)
|
_, _, err = image.client.ImageInspectWithRaw(ctx, image.id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
||||||
|
if !utils.IsDockerClientAvailable() {
|
||||||
|
return nil, fmt.Errorf("cannot find docker client executable")
|
||||||
|
}
|
||||||
|
|
||||||
// don't use the API, the CLI has more informative output
|
// don't use the API, the CLI has more informative output
|
||||||
fmt.Println("Image not available locally. Trying to pull '" + image.id + "'...")
|
fmt.Println("Image not available locally. Trying to pull '" + image.id + "'...")
|
||||||
err = utils.RunDockerCmd("pull", image.id)
|
err = utils.RunDockerCmd("pull", image.id)
|
||||||
|
@ -6,9 +6,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func IsDockerClientAvailable() bool {
|
||||||
|
_, err := exec.LookPath("docker")
|
||||||
|
return err == nil
|
||||||
|
}
|
||||||
|
|
||||||
// RunDockerCmd runs a given Docker command in the current tty
|
// RunDockerCmd runs a given Docker command in the current tty
|
||||||
func RunDockerCmd(cmdStr string, args ...string) error {
|
func RunDockerCmd(cmdStr string, args ...string) error {
|
||||||
|
|
||||||
allArgs := cleanArgs(append([]string{cmdStr}, args...))
|
allArgs := cleanArgs(append([]string{cmdStr}, args...))
|
||||||
|
|
||||||
cmd := exec.Command("docker", allArgs...)
|
cmd := exec.Command("docker", allArgs...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user