Skip to content

Commit 87effd3

Browse files
committed
add support for using a particular apt component
This provides a more flexible component, rather than hardcoded version+build
1 parent 925daad commit 87effd3

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

.github/actions/docker-opensips-publish/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
tag:
99
description: The Docker tag to publish the image
1010
required: false
11+
component:
12+
description: The apt component to pull the OpenSIPS deb from
13+
required: false
1114
cli:
1215
description: Indicates whether to install OpenSIPS CLI as well
1316
required: false
@@ -40,6 +43,7 @@ runs:
4043
test -n "${{ inputs.cli }}" && echo "OPENSIPS_CLI=${{ inputs.cli }}" >> $GITHUB_ENV || true
4144
test -n "${{ inputs.modules }}" && echo "OPENSIPS_EXTRA_MODULES='${{ inputs.modules }}'" >> $GITHUB_ENV || true
4245
test -n "${{ inputs.build }}" && echo "OPENSIPS_BUILD=\"${{ inputs.build }}\"" >> $GITHUB_ENV || true
46+
test -n "${{ inputs.component }}" && echo "OPENSIPS_COMPONENT=\"${{ inputs.component }}\"" >> $GITHUB_ENV || true
4347
4448
- name: Build the Docker image
4549
shell: bash

.github/workflows/docker-opensips-publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
description: Apt package build
1919
required: false
2020
default: releases
21+
component:
22+
description: Apt deb component
23+
required: false
2124
modules:
2225
description: Extra Modules
2326
required: false
@@ -37,5 +40,6 @@ jobs:
3740
cli: ${{ github.event.inputs.cli }}
3841
modules: ${{ github.event.inputs.modules }}
3942
build: ${{ github.event.inputs.build }}
43+
component: ${{ github.event.inputs.component }}
4044
docker-username: ${{ secrets.DOCKER_USERNAME }}
4145
docker-token: ${{ secrets.DOCKER_TOKEN }}

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ ARG OPENSIPS_VERSION=3.4
1010
ARG OPENSIPS_VERSION_MINOR
1111
ARG OPENSIPS_VERSION_REVISION=1
1212
ARG OPENSIPS_BUILD=releases
13+
ARG OPENSIPS_COMPONENT
1314

1415
#install basic components
1516
RUN apt-get -y update -qq && apt-get -y install gnupg2 ca-certificates
1617

1718
#add keyserver, repository
1819
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+
RUN echo "deb https://apt.opensips.org bullseye \
21+
$(test -z "${OPENSIPS_COMPONENT}" && \
22+
echo ${OPENSIPS_VERSION}-${OPENSIPS_BUILD} || \
23+
echo ${OPENSIPS_COMPONENT})" >/etc/apt/sources.list.d/opensips.list
2024

2125
RUN apt-get -y update -qq && \
2226
apt-get -y install \

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ OPENSIPS_VERSION ?= 3.4
33
OPENSIPS_VERSION_MINOR ?=
44
OPENSIPS_VERSION_REVISION ?=
55
OPENSIPS_BUILD ?= releases
6+
OPENSIPS_COMPONENT ?=
67
OPENSIPS_DOCKER_TAG ?= latest
78
OPENSIPS_CLI ?= true
89
OPENSIPS_EXTRA_MODULES ?=
@@ -19,6 +20,7 @@ build:
1920
--build-arg=OPENSIPS_VERSION_MINOR=$(OPENSIPS_VERSION_MINOR) \
2021
--build-arg=OPENSIPS_VERSION_REVISION=$(OPENSIPS_VERSION_REVISION) \
2122
--build-arg=OPENSIPS_CLI=${OPENSIPS_CLI} \
23+
--build-arg=OPENSIPS_COMPONENT=${OPENSIPS_COMPONENT} \
2224
--build-arg=OPENSIPS_EXTRA_MODULES="$(OPENSIPS_EXTRA_MODULES)" \
2325
$(DOCKER_ARGS) \
2426
--tag="opensips/opensips:$(OPENSIPS_DOCKER_TAG)" \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ You can set different variables to tune your deployment:
3434
* `OPENSIPS_DOCKER_TAG` - indicates the docker tag (Default: `latest`)
3535
* `OPENSIPS_CLI` - specifies whether to install opensips-cli (`true`) or not (`false`) (Default: `true`)
3636
* `OPENSIPS_EXTRA_MODULES` - specifies extra opensips modules to install (Default: no other module)
37+
* `OPENSIPS_COMPONENT` - specifies the opensips apt component to install (Default: ${OPENSIPS_VERSION}-${OPENSIPS_BUILD})
3738

3839
## Packages on DockerHub
3940

0 commit comments

Comments
 (0)