-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't run as root when building protobuf files
Signed-off-by: Fredrik Skogman <[email protected]>
- Loading branch information
1 parent
9bbc08f
commit 15b6eb0
Showing
4 changed files
with
54 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
# 3.18.2 | ||
FROM alpine@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b | ||
RUN apk add --update protoc protobuf-dev go git | ||
|
||
# Switch user | ||
ARG uid=1000 | ||
RUN adduser -u ${uid} -S builder | ||
|
||
RUN mkdir -p /home/builder | ||
RUN chown builder /home/builder | ||
|
||
USER builder | ||
WORKDIR /home/builder | ||
|
||
RUN go install github.com/chrusty/protoc-gen-jsonschema/cmd/[email protected] | ||
|
||
# This is required to get the field_behavior.proto file | ||
# NOTE: --filter=tree:0 performs a treeless clone; we do this to optimize cloning | ||
# this otherwise relatively heavy repository. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters