-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
106 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea | ||
vendor/ | ||
/whoamiudp | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
project_name: whoamiudp | ||
|
||
builds: | ||
- binary: whoamiudp | ||
goos: | ||
- windows | ||
- darwin | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm | ||
- arm64 | ||
goarm: | ||
- '7' | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^doc:' | ||
- '^chore:' | ||
- '^chore(deps):' | ||
- '^test:' | ||
- '^tests:' | ||
|
||
archives: | ||
- id: whoamiudp | ||
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm}}v{{ .Arm }}{{ end }}' | ||
format: tar.gz | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
files: | ||
- LICENSE | ||
|
||
docker_manifests: | ||
- name_template: 'traefik/whoamiudp:{{ .Tag }}' | ||
image_templates: | ||
- 'traefik/whoamiudp:{{ .Tag }}-amd64' | ||
- 'traefik/whoamiudp:{{ .Tag }}-arm64' | ||
- name_template: 'traefik/whoamiudp:latest' | ||
image_templates: | ||
- 'traefik/whoamiudp:{{ .Tag }}-amd64' | ||
- 'traefik/whoamiudp:{{ .Tag }}-arm64' | ||
- name_template: 'traefik/whoamiudp:v{{ .Major }}.{{ .Minor }}' | ||
image_templates: | ||
- 'traefik/whoamiudp:v{{ .Major }}.{{ .Minor }}-amd64' | ||
- 'traefik/whoamiudp:v{{ .Major }}.{{ .Minor }}-arm64' | ||
|
||
dockers: | ||
- use: buildx | ||
goos: linux | ||
goarch: amd64 | ||
dockerfile: buildx.Dockerfile | ||
image_templates: | ||
- 'traefik/whoamiudp:latest-amd64' | ||
- 'traefik/whoamiudp:{{ .Tag }}-amd64' | ||
- 'traefik/whoamiudp:v{{ .Major }}.{{ .Minor }}-amd64' | ||
build_flag_templates: | ||
- '--pull' | ||
- '--label=org.opencontainers.image.description=Tiny Go UDP server that prints OS information and request to output' | ||
- '--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.source={{.GitURL}}' | ||
- '--platform=linux/amd64' | ||
|
||
- use: buildx | ||
goos: linux | ||
goarch: arm64 | ||
dockerfile: buildx.Dockerfile | ||
image_templates: | ||
- 'traefik/whoamiudp:latest-arm64' | ||
- 'traefik/whoamiudp:{{ .Tag }}-arm64' | ||
- 'traefik/whoamiudp:v{{ .Major }}.{{ .Minor }}-arm64' | ||
build_flag_templates: | ||
- '--pull' | ||
- '--label=org.opencontainers.image.description=Tiny Go UDP server that prints OS information and request to output' | ||
- '--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.source={{.GitURL}}' | ||
- '--platform=linux/arm64' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,17 @@ | ||
# syntax=docker/dockerfile:1.2 | ||
FROM golang:1-alpine as builder | ||
|
||
RUN apk --no-cache --no-progress add git ca-certificates tzdata make \ | ||
&& update-ca-certificates \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
WORKDIR /go/whoamiudp | ||
|
||
# Download go modules | ||
COPY go.mod . | ||
#COPY go.sum . | ||
RUN GO111MODULE=on GOPROXY=https://proxy.golang.org go mod download | ||
|
||
COPY . . | ||
RUN GOARCH={{ .GoARCH }} GOARM={{ .GoARM }} make build | ||
|
||
# syntax=docker/dockerfile:1.2 | ||
# Create a minimal container to run a Golang static binary | ||
FROM scratch | ||
|
||
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /go/whoamiudp/whoamiudp . | ||
COPY whoamiudp / | ||
|
||
ENTRYPOINT ["/whoamiudp"] | ||
EXPOSE 8080 | ||
EXPOSE 80 |