Skip to content

Commit 7a64bf5

Browse files
committed
chore(ci): build docker images with goreleaser
1 parent 5cc00df commit 7a64bf5

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

.goreleaser.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
env:
2-
- GO111MODULE=on
2+
- CGO_ENABLED=0
33
builds:
44
- main: cmd/gcrgc/gcrgc.go
55
goos:
@@ -11,6 +11,32 @@ builds:
1111
- amd64
1212
- arm
1313
- arm64
14+
dockers:
15+
-
16+
goarch: amd64
17+
image_templates:
18+
- "graillus/gcrgc:{{ .Version }}-amd64"
19+
dockerfile: 'Dockerfile.goreleaser'
20+
use: buildx
21+
build_flag_templates:
22+
- "--pull"
23+
- "--platform=linux/amd64"
24+
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
25+
- "--label=org.opencontainers.image.url=https://github.com/graillus/gcrgc"
26+
- "--label=org.opencontainers.image.source=https://github.com/graillus/gcrgc"
27+
- "--label=org.opencontainers.image.description=A garbage collector tool for container registries"
28+
- "--label=org.opencontainers.image.created={{ .Date }}"
29+
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
30+
- "--label=org.opencontainers.image.version={{ .Version }}"
31+
- "--label=org.opencontainers.image.licenses=MIT"
32+
docker_manifests:
33+
- name_template: graillus/gcrgc:{{ .Version }}
34+
image_templates:
35+
- graillus/gcrgc:{{ .Version }}-amd64
36+
- name_template: graillus/gcrgc:latest
37+
image_templates:
38+
- graillus/gcrgc:{{ .Version }}-amd64
39+
1440
release:
1541
prerelease: auto
1642
changelog:

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ RUN go build -o bin/gcrgc cmd/gcrgc/gcrgc.go
77

88
FROM alpine
99

10-
COPY --from=build /go/src/github.com/graillus/gcrgc/bin/gcrgc /usr/local/bin/gcrgc
10+
COPY --from=build /go/src/github.com/graillus/gcrgc/bin/gcrgc /usr/bin/gcrgc
11+
12+
ENTRYPOINT ["/usr/bin/gcrgc"]

Dockerfile.goreleaser

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM alpine
2+
3+
COPY gcrgc /usr/bin/gcrgc
4+
5+
ENTRYPOINT ["/usr/bin/gcrgc"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ You can use a service account as well by setting the `GOOGLE_APPLICATION_CREDENT
3737
1. Download your [desired version](https://github.com/graillus/gcrgc/releases)
3838
2. Extract it
3939
```bash
40-
tar xvf gcrgc_0.4.0_linux_amd64.tar.gz
40+
tar xvf gcrgc_0.4.4_linux_amd64.tar.gz
4141
```
4242
3. Move binary to desired destination
4343
```bash

0 commit comments

Comments
 (0)