build/goreleaser: docker images

This commit is contained in:
Clement Sam 2021-06-08 02:55:18 +00:00
parent 14ed98c0a0
commit bb22384c73
2 changed files with 32 additions and 4 deletions

View File

@ -30,6 +30,33 @@ builds:
goos: [windows]
goarch: [386, amd64]
dockers:
- image_templates:
- 'profclems/glab:{{ .Tag }}'
- 'ghcr.io/profclems/glab:{{ .Tag }}'
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"
extra_files:
- scripts/entrypoint.sh
docker_manifests:
- name_template: 'profclems/glab:{{ .Tag }}'
image_templates:
- 'profclems/glab:{{ .Tag }}'
- name_template: 'profclems/glab:latest'
image_templates:
- 'profclems/glab:{{ .Tag }}'
- name_template: 'ghcr.io/profclems/glab:latest'
image_templates:
- 'ghcr.io/profclems/glab:{{ .Tag }}'
archives:
- id: nix
builds: [macos, linux]
@ -80,8 +107,9 @@ nfpms:
# Override default /usr/local/bin destination for binaries
# Since glab is already archived in the bin directory it would install in /usr/bin/glab
bindir: /usr
files:
"./share/man/man1/glab*.1": "/usr/share/man/man1"
contents:
- src: "./share/man/man1/glab*.1"
dst: "/usr/share/man/man1"
checksum:
name_template: 'checksums.txt'

View File

@ -1,4 +1,4 @@
FROM golang:1.16-alpine
FROM alpine:latest
RUN apk add --no-cache bash \
curl \
@ -14,5 +14,5 @@ CMD [ "-h" ]
COPY scripts/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
COPY dist/glab_*.apk /tmp/
COPY glab_*.apk /tmp/
RUN apk add --allow-untrusted /tmp/glab_*.apk