Skip to content

Commit

Permalink
feat(Alpine Dockerfile): use numeric user/group 1000:1000 for compati…
Browse files Browse the repository at this point in the history
…bility with K8s

The Kubernetes securityContext.runAsNonRoot option required numeric user IDs
  • Loading branch information
orlandothoeny committed May 11, 2023
1 parent 311920c commit 8bf5136
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ COPY src/ src/
RUN shards build --production --release --debug

FROM alpine:latest
RUN apk add --no-cache libssl1.1 pcre2 libevent libgcc
RUN apk add --no-cache libssl1.1 pcre2 libevent libgcc \
&& addgroup --gid 1000 amqpproxy \
&& adduser --no-create-home --disabled-password --uid 1000 amqpproxy -G amqpproxy
COPY --from=builder /tmp/bin/amqproxy /usr/bin/amqproxy
USER nobody:nogroup
USER 1000:1000
EXPOSE 5673
ENTRYPOINT ["/usr/bin/amqproxy", "--listen=0.0.0.0"]

0 comments on commit 8bf5136

Please sign in to comment.