Skip to content

Commit

Permalink
Stop using root user in docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsuereth committed Aug 15, 2024
1 parent 5ea660c commit 27d8c2e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Rust related build artifacts.
/target
.cargo/
wix/
scripts/
examples/

# Ignore output files generated by weaver
**/output/*
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ RUN cargo build --release
# The runtime image
FROM alpine:3.18.3
LABEL maintainer="The OpenTelemetry Authors"
RUN addgroup weaver \
&& adduser \
--ingroup weaver \
--no-create-home \
--disabled-password \
weaver
WORKDIR /weaver
COPY --from=weaver-build /build/target/release/weaver /weaver/weaver
USER weaver
ENTRYPOINT ["/weaver/weaver"]

0 comments on commit 27d8c2e

Please sign in to comment.