-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,31 @@ | ||
FROM quay.io/prometheus/busybox:latest | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
RubenHoms
Author
Contributor
|
||
MAINTAINER The Prometheus Authors <[email protected]> | ||
FROM debian:buster | ||
LABEL maintainer="Ruben Homs <[email protected]>" | ||
|
||
COPY opensips_exporter /bin/opensips_exporter | ||
USER root | ||
|
||
ENTRYPOINT ["/bin/opensips_exporter"] | ||
USER nobody | ||
EXPOSE 9434 | ||
# Set Environment Variables | ||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
ARG OPENSIPS_VERSION=3.0 | ||
ARG OPENSIPS_BUILD=releases | ||
|
||
#install basic components | ||
RUN apt update -qq && apt install -y gnupg2 ca-certificates | ||
|
||
#add keyserver, repository | ||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 049AD65B | ||
RUN echo "deb https://apt.opensips.org buster ${OPENSIPS_VERSION}-${OPENSIPS_BUILD}" >/etc/apt/sources.list.d/opensips.list | ||
|
||
RUN apt update -qq && apt install -y opensips curl net-tools procps | ||
|
||
RUN apt-get -y install opensips-http-modules | ||
|
||
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
EXPOSE 5060/udp | ||
EXPOSE 8888/tcp | ||
|
||
COPY run.sh /run.sh | ||
COPY opensips.cfg /etc/opensips/opensips.cfg | ||
|
||
ENTRYPOINT ["/run.sh"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.1.1 | ||
2.0.0 |
4 comments
on commit be37f63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is are a few go vet
warnings:
$ make vet
>> vetting code
# github.com/VoIPGRID/opensips_exporter/opensips
opensips/opensips.go:103:12: result of fmt.Errorf call not used
# github.com/VoIPGRID/opensips_exporter/processors
processors/load_processor.go:242:12: result of fmt.Errorf call not used
make: *** [Makefile:46: vet] Error 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a next step I would like to convert this to use go mod
, and have the vendor directory removed. Maybe even use goreleaser to build the docker images and debian packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you choose github.com/KeisukeYamashita/go-jsonrpc
over https://golang.org/pkg/net/rpc/jsonrpc/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you choose
github.com/KeisukeYamashita/go-jsonrpc
overhttps://golang.org/pkg/net/rpc/jsonrpc/
?
Hadn't realised there was a native package to do this, but I used this package because of this comment that helped me start the process of adding this functionality. Looking at the native package it says:
Package jsonrpc implements a JSON-RPC 1.0 ClientCodec and ServerCodec for the rpc package.
OpenSIPS implements JSON-RPC 2.0, which apparently doesn't have a native package yet so it wouldn't work with it either.
Seems that instead of only running the exporter in this docker image, it also includes OpenSIPS itself. I think that is not required