Skip to content

Commit

Permalink
Add docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelangel-nubla committed Apr 2, 2023
1 parent f37ca11 commit e15b295
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
58 changes: 57 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,64 @@ builds:
goarm:
- 6
- 7
dockers:
-
image_templates:
- "gcr.io/miguelangel-nubla/{{.ProjectName}}:{{ .Tag }}-amd64"
dockerfile: 'Dockerfile.goreleaser'
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.url=https://github.com/miguelangel-nubla/{{ .ProjectName }}"
- "--label=org.opencontainers.image.source=https://github.com/miguelangel-nubla/{{ .ProjectName }}"
extra_files:
- LICENSE.txt
-
image_templates:
- "gcr.io/miguelangel-nubla/{{.ProjectName}}:{{ .Tag }}-arm64v8"
dockerfile: 'Dockerfile.goreleaser'
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.url=https://github.com/miguelangel-nubla/{{ .ProjectName }}"
- "--label=org.opencontainers.image.source=https://github.com/miguelangel-nubla/{{ .ProjectName }}"
extra_files:
- LICENSE.txt
docker_manifests:
-
name_template: gcr.io/miguelangel-nubla/{{ .ProjectName }}:latest
image_templates:
- gcr.io/miguelangel-nubla/{{ .ProjectName }}:{{ .Tag }}-amd64
- gcr.io/miguelangel-nubla/{{ .ProjectName }}:{{ .Tag }}-arm64v8
-
name_template: gcr.io/miguelangel-nubla/{{ .ProjectName }}:{{ .Tag }}
image_templates:
- gcr.io/miguelangel-nubla/{{ .ProjectName }}:{{ .Tag }}-amd64
- gcr.io/miguelangel-nubla/{{ .ProjectName }}:{{ .Tag }}-arm64v8
-
name_template: gcr.io/miguelangel-nubla/{{.ProjectName}}:v{{ .Major }}
image_templates:
- gcr.io/miguelangel-nubla/{{ .ProjectName }}:{{ .Tag }}-amd64
- gcr.io/miguelangel-nubla/{{ .ProjectName }}:{{ .Tag }}-arm64v8

archives:
- format: tar.gz
-
rlcp: true
files:
- LICENSE*
- README*
- CHANGELOG*
format: tar.gz
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
Expand All @@ -51,6 +106,7 @@ archives:
format_overrides:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile.goreleaser
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM scratch
ENTRYPOINT ["/ipv6disc"]
COPY ipv6disc /
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Ensure you have Go installed on your system. If not, follow the instructions on
go install github.com/miguelangel-nubla/ipv6disc
```

### Or use the docker image
This may or may not work on your system. I was able to make it work with host networking and without `ipv6:true` in `/etc/docker/daemon.json`???. If you have experience and can help with ipv6 docker please let me know.
```
docker run -it --rm --network host gcr.io/miguelangel-nubla/ipv6disc -live
```

## Usage

By default, it will output the discovered hosts as JSON messages to `stdout`. You can easily parse the output with [`jq`](https://stedolan.github.io/jq/).
Expand Down

0 comments on commit e15b295

Please sign in to comment.