-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci(docker): build docker images and linux packages
- Loading branch information
Showing
3 changed files
with
69 additions
and
16 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 |
---|---|---|
|
@@ -35,6 +35,55 @@ changelog: | |
- Merge branch | ||
- go mod tidy | ||
|
||
nfpms: | ||
- file_name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' | ||
homepage: https://github.com/pixelfactoryio/needle | ||
description: Deliver Go binaries as fast and easily as possible | ||
maintainer: Amine Benseddik <[email protected]> | ||
license: MIT | ||
vendor: pixelfactory.io | ||
formats: | ||
- apk | ||
- deb | ||
- rpm | ||
|
||
dockers: | ||
- image_templates: | ||
- 'pixelfactory/needle:{{ .Tag }}-amd64' | ||
dockerfile: Dockerfile | ||
use_buildx: true | ||
build_flag_templates: | ||
- "--pull" | ||
- "--label=org.opencontainers.image.created={{.Date}}" | ||
- "--label=org.opencontainers.image.name={{.ProjectName}}" | ||
- "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
- "--label=org.opencontainers.image.version={{.Version}}" | ||
- "--label=org.opencontainers.image.source={{.GitURL}}" | ||
- "--platform=linux/amd64" | ||
- image_templates: | ||
- 'pixelfactory/needle:{{ .Tag }}-arm64' | ||
dockerfile: Dockerfile | ||
use_buildx: true | ||
build_flag_templates: | ||
- "--pull" | ||
- "--label=org.opencontainers.image.created={{.Date}}" | ||
- "--label=org.opencontainers.image.name={{.ProjectName}}" | ||
- "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
- "--label=org.opencontainers.image.version={{.Version}}" | ||
- "--label=org.opencontainers.image.source={{.GitURL}}" | ||
- "--platform=linux/arm64" | ||
goarch: arm64 | ||
|
||
docker_manifests: | ||
- name_template: 'pixelfactory/needle:{{ .Tag }}' | ||
image_templates: | ||
- 'pixelfactory/needle:{{ .Tag }}-amd64' | ||
- 'pixelfactory/needle:{{ .Tag }}-arm64' | ||
- name_template: 'pixelfactory/needle:latest' | ||
image_templates: | ||
- 'pixelfactory/needle:{{ .Tag }}-amd64' | ||
- 'pixelfactory/needle:{{ .Tag }}-arm64' | ||
|
||
archives: | ||
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' | ||
replacements: | ||
|
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,19 +1,8 @@ | ||
FROM golang:1.15-alpine AS builder | ||
FROM alpine:3.13 | ||
|
||
RUN apk --no-cache update && \ | ||
apk --no-cache upgrade && \ | ||
apk --no-cache add git build-base | ||
COPY needle_*.apk /tmp/ | ||
|
||
WORKDIR /build | ||
RUN apk add --allow-untrusted /tmp/needle_*.apk \ | ||
&& rm -fr /tmp/needle_*.apk | ||
|
||
COPY . . | ||
|
||
RUN go mod download | ||
|
||
RUN make bin/needle | ||
|
||
FROM alpine:3.12 | ||
|
||
COPY --from=builder /build/bin/needle /usr/bin/needle | ||
|
||
ENTRYPOINT ["/usr/bin/needle"] | ||
ENTRYPOINT ["/usr/local/bin/needle"] |