├── .github ├── actions │ └── docker-opensips-publish │ │ └── action.yml └── workflows │ ├── docker-opensips-publish.yml │ └── docker-readme.yml ├── Dockerfile ├── Makefile ├── README.md └── SECURITY.md /.github/actions/docker-opensips-publish/action.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Publish OpenSIPS Image in Docker Hub 3 | description: Builds and publishes OpenSIPS docker image to Docker Hub 4 | inputs: 5 | version: 6 | description: OpenSIPS Version to build the image for 7 | required: false 8 | tag: 9 | description: The Docker tag to publish the image 10 | required: false 11 | cli: 12 | description: Indicates whether to install OpenSIPS CLI as well 13 | required: false 14 | modules: 15 | description: Space separated additional packets to install 16 | required: false 17 | build: 18 | description: Indicate the build to use 19 | required: false 20 | docker-username: 21 | description: The Docker username to push the image with 22 | required: true 23 | docker-token: 24 | description: The Docker token used to authenticate 25 | required: true 26 | 27 | runs: 28 | using: "composite" 29 | 30 | steps: 31 | - uses: actions/checkout@v4 32 | with: 33 | repository: OpenSIPS/docker-opensips 34 | 35 | - name: Prepare Environment 36 | shell: bash 37 | run: | 38 | test -n "${{ inputs.version }}" && echo "OPENSIPS_VERSION=${{ inputs.version }}" >> $GITHUB_ENV || true 39 | test -n "${{ inputs.tag }}" && echo "OPENSIPS_DOCKER_TAG=${{ inputs.tag }}" >> $GITHUB_ENV || true 40 | test -n "${{ inputs.cli }}" && echo "OPENSIPS_CLI=${{ inputs.cli }}" >> $GITHUB_ENV || true 41 | test -n "${{ inputs.modules }}" && echo "OPENSIPS_EXTRA_MODULES=\"${{ inputs.modules }}\"" >> $GITHUB_ENV || true 42 | test -n "${{ inputs.build }}" && echo "OPENSIPS_BUILD=\"${{ inputs.build }}\"" >> $GITHUB_ENV || true 43 | 44 | - name: Build the Docker image 45 | shell: bash 46 | id: build 47 | run: make build 2>&1 | tee /tmp/build.log && grep "naming to docker.io" /tmp/build.log | awk -F'[ /]' '{print "DOCKER_TAG=" $5 "/" $6 }' >> $GITHUB_OUTPUT 48 | 49 | - name: Log in to Docker Hub 50 | uses: docker/login-action@v3 51 | with: 52 | username: ${{ inputs.docker-username }} 53 | password: ${{ inputs.docker-token }} 54 | 55 | - name: Publish the Docker image 56 | shell: bash 57 | run: docker push ${{ steps.build.outputs.DOCKER_TAG }} 58 | -------------------------------------------------------------------------------- /.github/workflows/docker-opensips-publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish OpenSIPS Image in Docker Hub 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | version: 7 | description: Version 8 | required: false 9 | tag: 10 | description: Tag 11 | required: false 12 | cli: 13 | description: Install CLI 14 | required: false 15 | type: boolean 16 | default: true 17 | build: 18 | description: Apt package build 19 | required: false 20 | default: releases 21 | modules: 22 | description: Extra Modules 23 | required: false 24 | 25 | jobs: 26 | 27 | publish: 28 | 29 | runs-on: ubuntu-latest 30 | 31 | steps: 32 | - name: Publish OpenSIPS Docker image 33 | uses: OpenSIPS/docker-opensips/.github/actions/docker-opensips-publish@main 34 | with: 35 | version: ${{ github.event.inputs.version }} 36 | tag: ${{ github.event.inputs.tag }} 37 | cli: ${{ github.event.inputs.cli }} 38 | modules: ${{ github.event.inputs.modules }} 39 | build: ${{ github.event.inputs.build }} 40 | docker-username: ${{ secrets.DOCKER_USERNAME }} 41 | docker-token: ${{ secrets.DOCKER_TOKEN }} 42 | -------------------------------------------------------------------------------- /.github/workflows/docker-readme.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Update Docker Hub Description 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - README.md 9 | - .github/workflows/docker-readme.yml 10 | 11 | jobs: 12 | dockerHubDescription: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | 17 | 18 | - name: Docker Hub Description 19 | uses: peter-evans/dockerhub-description@v4 20 | with: 21 | username: ${{ secrets.DOCKER_USERNAME }} 22 | password: ${{ secrets.DOCKER_TOKEN }} 23 | repository: opensips/opensips 24 | readme-filepath: ./README.md 25 | short-description: ${{ github.event.repository.description }} 26 | enable-url-completion: true 27 | 28 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bullseye 2 | LABEL maintainer="Razvan Crainea " 3 | 4 | USER root 5 | 6 | # Set Environment Variables 7 | ENV DEBIAN_FRONTEND noninteractive 8 | 9 | ARG OPENSIPS_VERSION=3.4 10 | ARG OPENSIPS_VERSION_MINOR 11 | ARG OPENSIPS_VERSION_REVISION=1 12 | ARG OPENSIPS_BUILD=releases 13 | 14 | #install basic components 15 | RUN apt-get -y update -qq && apt-get -y install gnupg2 ca-certificates 16 | 17 | #add keyserver, repository 18 | RUN apt-key adv --fetch-keys https://apt.opensips.org/pubkey.gpg 19 | RUN echo "deb https://apt.opensips.org bullseye ${OPENSIPS_VERSION}-${OPENSIPS_BUILD}" >/etc/apt/sources.list.d/opensips.list 20 | 21 | RUN apt-get -y update -qq && \ 22 | apt-get -y install \ 23 | opensips${OPENSIPS_VERSION_MINOR:+=$OPENSIPS_VERSION.$OPENSIPS_VERSION_MINOR-$OPENSIPS_VERSION_REVISION} 24 | 25 | ARG OPENSIPS_CLI=false 26 | RUN if [ ${OPENSIPS_CLI} = true ]; then \ 27 | echo "deb https://apt.opensips.org bullseye cli-nightly" >/etc/apt/sources.list.d/opensips-cli.list \ 28 | && apt-get -y update -qq && apt-get -y install opensips-cli \ 29 | ;fi 30 | 31 | ARG OPENSIPS_EXTRA_MODULES 32 | RUN if [ -n "${OPENSIPS_EXTRA_MODULES}" ]; then \ 33 | apt-get -y install ${OPENSIPS_EXTRA_MODULES} \ 34 | ;fi 35 | 36 | RUN rm -rf /var/lib/apt/lists/* 37 | RUN sed -i "s/stderror_enabled=no/stderror_enabled=yes/g" /etc/opensips/opensips.cfg && \ 38 | sed -i "s/syslog_enabled=yes/syslog_enabled=no/g" /etc/opensips/opensips.cfg 39 | 40 | EXPOSE 5060/udp 41 | 42 | ENTRYPOINT ["/usr/sbin/opensips", "-F"] 43 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | NAME ?= opensips 2 | OPENSIPS_VERSION ?= 3.4 3 | OPENSIPS_VERSION_MINOR ?= 4 | OPENSIPS_VERSION_REVISION ?= 5 | OPENSIPS_BUILD ?= releases 6 | OPENSIPS_DOCKER_TAG ?= latest 7 | OPENSIPS_CLI ?= true 8 | OPENSIPS_EXTRA_MODULES ?= 9 | DOCKER_ARGS ?= 10 | 11 | all: build start 12 | 13 | .PHONY: build start 14 | build: 15 | docker build \ 16 | --no-cache \ 17 | --build-arg=OPENSIPS_BUILD=$(OPENSIPS_BUILD) \ 18 | --build-arg=OPENSIPS_VERSION=$(OPENSIPS_VERSION) \ 19 | --build-arg=OPENSIPS_VERSION_MINOR=$(OPENSIPS_VERSION_MINOR) \ 20 | --build-arg=OPENSIPS_VERSION_REVISION=$(OPENSIPS_VERSION_REVISION) \ 21 | --build-arg=OPENSIPS_CLI=${OPENSIPS_CLI} \ 22 | --build-arg=OPENSIPS_EXTRA_MODULES=$(OPENSIPS_EXTRA_MODULES) \ 23 | $(DOCKER_ARGS) \ 24 | --tag="opensips/opensips:$(OPENSIPS_DOCKER_TAG)" \ 25 | . 26 | 27 | start: 28 | docker run -d --name $(NAME) opensips/opensips:$(OPENSIPS_DOCKER_TAG) 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenSIPS Docker Image 2 | http://www.opensips.org/ 3 | 4 | Docker recipe for building and starting an OpenSIPS image 5 | 6 | ## Building the image 7 | You can build the docker image by running: 8 | ``` 9 | make build 10 | ``` 11 | 12 | This command will build a docker image with OpenSIPS master version taken from 13 | the git repository. To build a different git version, you can run: 14 | ``` 15 | OPENSIPS_VERSION=2.2 make build 16 | ``` 17 | 18 | To build with MySQL support: 19 | ``` 20 | OPENSIPS_EXTRA_MODULES=opensips-mysql-module make build 21 | ``` 22 | 23 | To start the image, simply run: 24 | ``` 25 | make start 26 | ``` 27 | 28 | ## Variables 29 | You can set different variables to tune your deployment: 30 | * `OPENSIPS_VERSION` - sets the opensips version (Default: `3.4`) 31 | * `OPENSIPS_VERSION_MINOR` - forces a specific minor version of opensips (Default: not used, latest will be installed) 32 | * `OPENSIPS_VERSION_REVISION` - forces a specific revision/build of opensips; only taken into consideration if `OPENSIPS_VERSION_MINOR` is provided (Default: 1) 33 | * `OPENSIPS_BUILD` - specifies the build to use, `nightly` or `releases` (Default: `releases`) 34 | * `OPENSIPS_DOCKER_TAG` - indicates the docker tag (Default: `latest`) 35 | * `OPENSIPS_CLI` - specifies whether to install opensips-cli (`true`) or not (`false`) (Default: `true`) 36 | * `OPENSIPS_EXTRA_MODULES` - specifies extra opensips modules to install (Default: no other module) 37 | 38 | ## Packages on DockerHub 39 | 40 | Released docker packages are visible on DockerHub 41 | https://hub.docker.com/r/opensips/opensips 42 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | All available versions are eligible for security updates 6 | 7 | ## Reporting a Vulnerability 8 | 9 | For any security/vulnerability issues you may discover, please send us a full report at security@opensips.org. 10 | --------------------------------------------------------------------------------