Skip to content

Commit dcd70aa

Browse files
Support adjusting the number of file description
Signed-off-by: 22fortisetliber <[email protected]>
1 parent d1387fe commit dcd70aa

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Diff for: cmd/cortex/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ ARG TARGETARCH
44
RUN apk add --no-cache ca-certificates
55
COPY migrations /migrations/
66
COPY cortex-$TARGETARCH /bin/cortex
7+
COPY run.sh /bin/run.sh
8+
RUN chmod +x /bin/run.sh
79
EXPOSE 80
8-
ENTRYPOINT [ "/bin/cortex" ]
10+
ENTRYPOINT [ "/bin/run.sh" ]
911

1012
ARG revision
1113
LABEL org.opencontainers.image.title="cortex" \

Diff for: cmd/cortex/run.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
if [ -n "${CORTEX_ULIMIT_NOFILES:-}" ]; then
3+
current_limit=$(ulimit -n)
4+
if [ "$current_limit" != "unlimited" ]; then
5+
if [ $CORTEX_ULIMIT_NOFILES -gt $current_limit ]; then
6+
echo "Setting file description limit to $CORTEX_ULIMIT_NOFILES"
7+
ulimit -n $CORTEX_ULIMIT_NOFILES
8+
fi
9+
fi
10+
fi
11+
ulimit -a
12+
exec /bin/cortex "$@"

0 commit comments

Comments
 (0)