Skip to content

Commit

Permalink
Added GNU diff and user home to Docker image (#39)
Browse files Browse the repository at this point in the history
* Added user home to Docker image

* Add group separately too

* Fix adding user
  • Loading branch information
applejag authored Apr 8, 2024
1 parent 1123e3d commit f4aa41b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ build
.dockerignore
.gitignore
Dockerfile
*.Dockerfile
Earthfile
**/*.md
**/*.license
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ RUN go test -v ./... \
-ldflags "-X github.com/RiskIdent/jelease/cmd.appVersion=$VERSION" \
-o build/jelease main.go

FROM docker.io/library/alpine
RUN apk add --no-cache ca-certificates patch git git-lfs helm
# NOTE: When updating here, remember to also update in ./goreleaser.Dockerfile
FROM docker.io/library/alpine AS final
RUN apk add --no-cache ca-certificates diffutils patch git git-lfs helm \
&& addgroup -g 10000 jelease \
&& adduser -D -u 10000 -G jelease jelease
COPY --from=build /jelease/build/jelease /usr/local/bin/
CMD ["jelease", "serve"]
USER 10000
Expand Down
5 changes: 4 additions & 1 deletion goreleaser.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
#
# SPDX-License-Identifier: CC0-1.0

# NOTE: When updating here, remember to also update in ./Dockerfile
FROM docker.io/library/alpine
RUN apk add --no-cache ca-certificates patch git git-lfs helm
RUN apk add --no-cache ca-certificates diffutils patch git git-lfs helm \
&& addgroup -g 10000 jelease \
&& adduser -D -u 10000 -G jelease jelease
COPY jelease /usr/local/bin/
CMD ["jelease", "serve"]
USER 10000
Expand Down

0 comments on commit f4aa41b

Please sign in to comment.