Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Fredrik Skogman <[email protected]>
Signed-off-by: Bob Callaway <[email protected]>
  • Loading branch information
bobcallaway and kommendorkapten authored Jan 14, 2025
1 parent 6067fad commit 574d51d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUST_ACTION ?= run -p sigstore-protobuf-specs-codegen
PLATFORM ?= linux/amd64
UID ?= $(shell id -u)
GID ?= $(shell id -g)
DOCKER_BUILD = docker build --platform ${PLATFORM} --build-arg UID=${UID} --build-arg GID=${GID}
DOCKER_BUILD = docker build --platform ${PLATFORM} --build-arg UID=${UID}
DOCKER_RUN = docker run --platform ${PLATFORM} --user ${UID}:${GID}

PROTOS = $(shell find protos/ -iname "*.proto" | sed 's|^|/defs/|')
Expand Down
7 changes: 3 additions & 4 deletions protoc-builder/Dockerfile.protoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ RUN apt-get update && apt-get install -y unzip git

# Set up user and group to match host we're building the container on
ARG UID
ARG GID

RUN addgroup --gid ${GID} myuser && adduser --uid ${UID} --ingroup myuser --disabled-password myuser
RUN adduser --uid ${UID} --disabled-password myuser

# Set permissions on the output directories so the user can write to them
RUN chown myuser:myuser /protobuf /googleapis
RUN chown myuser /protobuf /googleapis

# Switch to user to execute the remaining commands
USER myuser
Expand All @@ -26,7 +25,7 @@ USER myuser
ARG PROTOC_VERSION=v21.6
ARG PROTOC_CHECKSUM=sha256:6a9fc36363a2d05d73fc363a46cd57d849068d33305db39f77daac8ba073e818

ADD --chown=myuser:myuser --checksum=${PROTOC_CHECKSUM} https://github.com/protocolbuffers/protobuf/releases/download/${PROTOC_VERSION}/protoc-${PROTOC_VERSION#v}-linux-x86_64.zip /tmp/protoc.zip
ADD --chown=myuser --checksum=${PROTOC_CHECKSUM} https://github.com/protocolbuffers/protobuf/releases/download/${PROTOC_VERSION}/protoc-${PROTOC_VERSION#v}-linux-x86_64.zip /tmp/protoc.zip
RUN unzip -d /protobuf /tmp/protoc.zip
RUN chmod 755 /protobuf/bin/protoc

Expand Down

0 comments on commit 574d51d

Please sign in to comment.