Skip to content

Commit

Permalink
fix: add cap_net_bind_service=+ep to /usr/bin/node (#25385)
Browse files Browse the repository at this point in the history
In order for the container to bind to low ports the node binary needs to have cap_net_bind_service. This is needed besides adding the  capability when starting the container.
  • Loading branch information
rklaren committed Jan 2, 2025
1 parent e48cd22 commit 8fa6a3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FROM linux-${TARGETARCH}-alpine AS base

ENV NODE_ENV=production
WORKDIR /app
RUN apk add --no-cache tzdata eudev tini nodejs
RUN apk add --no-cache tzdata eudev tini nodejs libcap

# Dependencies and build
FROM base AS deps
Expand Down Expand Up @@ -47,6 +47,7 @@ COPY package.json LICENSE index.js data/configuration.example.yaml ./

COPY docker/docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
RUN setcap 'cap_net_bind_service=+ep' /usr/bin/node

RUN mkdir /app/data

Expand Down

0 comments on commit 8fa6a3c

Please sign in to comment.