Skip to content

Commit e1656ac

Browse files
committed
feat: Use distroless/static as base image
1 parent fa42873 commit e1656ac

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [6.4.0] - 2022-03-10
8+
## [6.5.0] - 2022-06-24
9+
### Changed
10+
* Use [distroless/static:nonroot](https://github.com/GoogleContainerTools/distroless/tree/main/base) as
11+
base image for the dockerized version of `git-semver` and build with Golang 1.18.
12+
13+
## [6.4.0] - 2022-06-24
914
### Changed
1015
* If two annotated tags point to the same commit `git-semver` will now select the one that
1116
was created last. E.g.
@@ -106,6 +111,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
106111

107112

108113
[1]: https://semver.org/#spec-item-11
114+
[6.5.0]: https://github.com/mdomke/git-semver/compare/v6.4.0...v6.5.0
109115
[6.4.0]: https://github.com/mdomke/git-semver/compare/v6.3.0...v6.4.0
110116
[6.3.0]: https://github.com/mdomke/git-semver/compare/v6.2.0...v6.3.0
111117
[6.2.0]: https://github.com/mdomke/git-semver/compare/v6.1.1...v6.2.0

Dockerfile

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
1-
FROM golang:1.16-buster as builder
2-
ENV USER=semver
3-
ENV UID=10001
4-
RUN adduser \
5-
--disabled-password \
6-
--gecos "" \
7-
--home "/nonexistent" \
8-
--shell "/sbin/nologin" \
9-
--no-create-home \
10-
--uid "${UID}" \
11-
"${USER}"
1+
FROM golang:1.18-bullseye as builder
122
WORKDIR /go/src/github.com/mdomke/git-semver
133
COPY . .
144
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags='-w -s -extldflags="-static"' -a -o /go/bin/git-semver
155

16-
FROM scratch
17-
COPY --from=builder /etc/passwd /etc/passwd
18-
COPY --from=builder /etc/group /etc/group
6+
FROM gcr.io/distroless/static:nonroot
197
COPY --from=builder /go/bin/git-semver /bin/git-semver
20-
USER semver:semver
218
WORKDIR /git-semver
229
ENTRYPOINT ["/bin/git-semver"]

0 commit comments

Comments
 (0)