Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get -y update -qq && \
apt-get -y install \
opensips${OPENSIPS_VERSION_MINOR:+=$OPENSIPS_VERSION.$OPENSIPS_VERSION_MINOR-$OPENSIPS_VERSION_REVISION}

ARG OPENSIPS_CLI=false
ARG OPENSIPS_CLI=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately this is not the correct fix, as one might compile it with OPENSIPS_CLI=false - for example this is how we build the sipssert image.
The correct fix would be to exit 1 if OPENSIPS_CLI is false, or skip the healthcheck altoghether - not sure that is possible though

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. If OPENSIPS_CLI is false, and if the opensips-cli is not installed, I don't know of any other way to perform healthcheck. Please forgive me, my English is not very good.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the PR open, as soon as I have some time, I will try to adapt it myself :).
Thanks for your contribution!

RUN if [ ${OPENSIPS_CLI} = true ]; then \
echo "deb https://apt.opensips.org bullseye cli-nightly" >/etc/apt/sources.list.d/opensips-cli.list \
&& apt-get -y update -qq && apt-get -y install opensips-cli \
Expand All @@ -38,5 +38,6 @@ RUN sed -i "s/stderror_enabled=no/stderror_enabled=yes/g" /etc/opensips/opensips
sed -i "s/syslog_enabled=yes/syslog_enabled=no/g" /etc/opensips/opensips.cfg

EXPOSE 5060/udp

HEALTHCHECK --interval=15s --timeout=5s \
CMD opensips-cli -x mi uptime|grep -q "Up time" || exit 1
ENTRYPOINT ["/usr/sbin/opensips", "-F"]