Skip to content

Commit d137716

Browse files
authored
add support for building alpine image (frain-dev#1108)
* feat: add support for building alpine image * fix: add entrypoint
1 parent 0bd22b9 commit d137716

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

.goreleaser.yml

+16
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@ dockers:
5454
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
5555
- --label=org.opencontainers.image.licenses=MPL-2.0
5656

57+
- image_templates:
58+
- "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:{{ .Tag }}-slim"
59+
goos: linux
60+
goarch: amd64
61+
dockerfile: slim.Dockerfile
62+
ids:
63+
- cobin
64+
build_flag_templates:
65+
- --platform=linux/amd64
66+
- --label=org.opencontainers.image.title={{ .ProjectName }}
67+
- --label=org.opencontainers.image.description=A fast & secure open source webhooks service
68+
- --label=org.opencontainers.image.url=https://github.com/{{ .Env.REPO_NAME }}
69+
- --label=org.opencontainers.image.source=https://github.com/{{ .Env.REPO_NAME }}
70+
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
71+
- --label=org.opencontainers.image.licenses=MPL-2.0
72+
5773
checksum:
5874
name_template: "{{ .ProjectName}}_checksums.txt"
5975

.publisher.yml

+17
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,23 @@ dockers:
105105
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
106106
- --label=org.opencontainers.image.licenses=MPL-2.0
107107

108+
- image_templates:
109+
- "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:latest-slim"
110+
- "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:{{ .Tag }}-slim"
111+
goos: linux
112+
goarch: amd64
113+
dockerfile: slim.Dockerfile
114+
ids:
115+
- cobin
116+
build_flag_templates:
117+
- --platform=linux/amd64
118+
- --label=org.opencontainers.image.title={{ .ProjectName }}
119+
- --label=org.opencontainers.image.description=A fast & secure open source webhooks service
120+
- --label=org.opencontainers.image.url=https://github.com/{{ .Env.REPO_NAME }}
121+
- --label=org.opencontainers.image.source=https://github.com/{{ .Env.REPO_NAME }}
122+
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
123+
- --label=org.opencontainers.image.licenses=MPL-2.0
124+
108125
checksum:
109126
name_template: "{{ .ProjectName}}_checksums.txt"
110127

release.Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
FROM gcr.io/distroless/base
2-
# the name of the binary generated by goreleaser
1+
FROM alpine:3.16.2
2+
33
COPY convoy /cmd
4+
RUN chmod +x /cmd
5+
RUN apk add --no-cache gcompat
46
ENTRYPOINT [ "/cmd" ]
5-
CMD ["server", "--config", "convoy.json"]
7+
CMD ["server", "--config", "/convoy.json"]

slim.Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM gcr.io/distroless/base
2+
# the name of the binary generated by goreleaser
3+
COPY convoy /cmd
4+
ENTRYPOINT [ "/cmd" ]
5+
CMD ["server", "--config", "convoy.json"]

0 commit comments

Comments
 (0)