Skip to content

Commit

Permalink
feat: build image with default user and group 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
mindhells committed Jan 31, 2025
1 parent 8c610e2 commit 2c34a99
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ FROM golang:1.23-bookworm AS build
RUN apt-get update \
&& apt-get install -y protobuf-compiler

RUN groupadd --gid 1000 app && useradd -u 1000 -g app app

WORKDIR /go/src/github.com/softonic/homing-pigeon

COPY . .
Expand All @@ -12,6 +14,10 @@ RUN make build &&\

FROM scratch

COPY --from=build /go/src/github.com/softonic/homing-pigeon/bin/homing-pigeon /
COPY --from=build /etc/passwd /etc/passwd
COPY --from=build /etc/group /etc/group
COPY --chown=app:app --from=build /go/src/github.com/softonic/homing-pigeon/bin/homing-pigeon /

USER app

ENTRYPOINT ["/homing-pigeon", "-logtostderr"]

0 comments on commit 2c34a99

Please sign in to comment.