Skip to content

Commit

Permalink
Merge pull request #7 from bibace/upgrade-base-image-to-buster
Browse files Browse the repository at this point in the history
upgrade base debian image to buster
  • Loading branch information
razvancrainea committed Jul 10, 2020
2 parents 4645ba3 + 6cf3619 commit d5592ea
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
47 changes: 38 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,50 @@
FROM debian:stretch
MAINTAINER Razvan Crainea <razvan@opensips.org>
FROM debian:buster
LABEL maintainer="Razvan Crainea <razvan@opensips.org>"

USER root

# Set Environment Variables
ENV DEBIAN_FRONTEND noninteractive

ARG VERSION=3.0
ARG BUILD=nightly
ARG OPENSIPS_VERSION=3.0
ARG OPENSIPS_BUILD=releases

RUN apt-get update -qq && apt-get install -y gnupg2
#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 http://apt.opensips.org jessie $VERSION-$BUILD" >/etc/apt/sources.list.d/opensips.list
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

ARG OPENSIPS_CLI=false
RUN if [ ${OPENSIPS_CLI} = true ]; then \
echo "deb https://apt.opensips.org buster cli-${OPENSIPS_BUILD}" >/etc/apt/sources.list.d/opensips-cli.list \
&& apt update -qq && apt -y install opensips-cli \
;fi

ARG OPENSIPS_JSON_MODULE=false
RUN if [ ${OPENSIPS_JSON_MODULE} = true ]; then \
apt-get -y install opensips-json-module \
;fi

ARG OPENSIPS_MYSQL_MODULE=false
RUN if [ ${OPENSIPS_MYSQL_MODULE} = true ]; then \
apt-get -y install opensips-mysql-module \
;fi

ARG OPENSIPS_HTTP_MODULE=false
RUN if [ ${OPENSIPS_HTTP_MODULE} = true ]; then \
apt-get -y install opensips-http-modules \
;fi

RUN apt-get update -qq && apt-get install -y opensips
ARG OPENSIPS_DIALPLAN_MODULE=false
RUN if [ ${OPENSIPS_DIALPLAN_MODULE} = true ]; then \
apt-get -y install opensips-dialplan-module \
;fi

RUN sed -i "s/RUN_OPENSIPS=no/RUN_OPENSIPS=yes/g" /etc/default/opensips
RUN sed -i "s/DAEMON=\/sbin\/opensips/DAEMON=\/usr\/sbin\/opensips/g" /etc/init.d/opensips
RUN rm -rf /var/lib/apt/lists/*

EXPOSE 5060/udp

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ make start

## Packages on DockerHub

Released docker packages are visible on DockerHub
Released docker packages are visible on DockerHub
https://hub.docker.com/r/opensips/opensips
6 changes: 4 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/bash

HOST_IP=$(ip route get 8.8.8.8 | head -n +1 | tr -s " " | cut -d " " -f 7)
sed -i "s/RUN_OPENSIPS=no/RUN_OPENSIPS=yes/g" /etc/default/opensips
sed -i "s/DAEMON=\/sbin\/opensips/DAEMON=\/usr\/sbin\/opensips/g" /etc/init.d/opensips

sed -i "s/listen=.*/listen=udp:${HOST_IP}:5060/g" /etc/opensips/opensips.cfg
HOST_IP=$(ip route get 8.8.8.8 | head -n +1 | tr -s " " | cut -d " " -f 7)
sed -i "s/^listen=udp.*5060/listen=udp:${HOST_IP}:5060/g" /etc/opensips/opensips.cfg

# skip syslog and run opensips at stderr
/usr/sbin/opensips -FE

0 comments on commit d5592ea

Please sign in to comment.