Skip to content

Commit

Permalink
build/goreleaser: docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
profclems committed Jun 8, 2021
1 parent 14ed98c commit bb22384
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
32 changes: 30 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16-alpine
FROM alpine:latest

RUN apk add --no-cache bash \
curl \
Expand All @@ -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

0 comments on commit bb22384

Please sign in to comment.