support goreleaser driven docker build

This commit is contained in:
Alex Goodman 2018-10-24 21:48:21 -04:00
parent 5dfd9fb9e8
commit 6e87804f2d
No known key found for this signature in database
GPG Key ID: 05328C611D8A520E
3 changed files with 36 additions and 2 deletions

View File

@ -10,10 +10,23 @@ builds:
- amd64
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.buildTime={{.Date}}`.
dockers:
-
binary: dive
image_templates:
- "wagoodman/dive:{{ .Tag }}"
- "wagoodman/dive:v{{ .Major }}"
- "wagoodman/dive:v{{ .Major }}.{{ .Minor }}"
- "wagoodman/dive:latest"
- "quay.io/wagoodman/dive:{{ .Tag }}"
- "quay.io/wagoodman/dive:v{{ .Major }}"
- "quay.io/wagoodman/dive:v{{ .Major }}.{{ .Minor }}"
- "quay.io/wagoodman/dive:latest"
archive:
format: tar.gz
fpm:
nfpm:
license: MIT
homepage: https://github.com/wagoodman/dive/
formats:
@ -23,4 +36,4 @@ fpm:
brew:
github:
owner: wagoodman
name: homebrew-dive
name: homebrew-dive

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM debian:stable-slim
COPY dive /
ENTRYPOINT ["/dive"]

View File

@ -73,3 +73,21 @@ or download a Darwin build from the releases page.
go get github.com/wagoodman/dive
```
**Docker**
```bash
docker pull wagoodman/dive
```
or
```bash
docker pull quay.io/wagoodman/dive
```
When running you'll need to include the docker client binary and socket file:
```bash
docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(which docker):/bin/docker \
wagoodman/dive:latest nginx:latest
```