Skip to content

Commit 56fb3a4

Browse files
authored
Refresh Docker image for post-Bullseye (maintaining compatibility with and defaulting to it) (#26)
* Refresh Docker image for post-Bullseye (maintaining compatibility with and default to it) * Document new option accordingly
1 parent a0667e7 commit 56fb3a4

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM debian:bullseye AS base
1+
ARG DEBIAN_RELEASE=bullseye
2+
FROM debian:${DEBIAN_RELEASE} AS base
23
LABEL maintainer="Razvan Crainea <razvan@opensips.org>"
34

45
USER root
@@ -13,11 +14,12 @@ ARG OPENSIPS_BUILD=releases
1314
ARG OPENSIPS_COMPONENT
1415

1516
#install basic components
16-
RUN apt-get -y update -qq && apt-get -y install gnupg2 ca-certificates
17+
RUN apt-get -y update -qq && apt-get -y install gnupg ca-certificates curl
1718

1819
#add keyserver, repository
19-
RUN apt-key adv --fetch-keys https://apt.opensips.org/pubkey.gpg
20-
RUN echo "deb https://apt.opensips.org bullseye \
20+
RUN curl https://apt.opensips.org/opensips-org.gpg -o /usr/share/keyrings/opensips-org.gpg
21+
RUN DEBIAN_RELEASE=$(grep VERSION_CODENAME /etc/os-release | cut -f2 -d '=') && \
22+
echo "deb [signed-by=/usr/share/keyrings/opensips-org.gpg] https://apt.opensips.org ${DEBIAN_RELEASE} \
2123
$(test -z "${OPENSIPS_COMPONENT}" && \
2224
echo ${OPENSIPS_VERSION}-${OPENSIPS_BUILD} || \
2325
echo ${OPENSIPS_COMPONENT})" >/etc/apt/sources.list.d/opensips.list
@@ -30,7 +32,8 @@ ARG OPENSIPS_CLI=false
3032
ENV OPENSIPS_CLI_ENV=${OPENSIPS_CLI}
3133

3234
RUN if [ ${OPENSIPS_CLI} = true ]; then \
33-
echo "deb https://apt.opensips.org bullseye cli-nightly" >/etc/apt/sources.list.d/opensips-cli.list \
35+
DEBIAN_RELEASE=$(grep VERSION_CODENAME /etc/os-release | cut -f2 -d '=') && \
36+
echo "deb https://apt.opensips.org ${DEBIAN_RELEASE} cli-nightly" >/etc/apt/sources.list.d/opensips-cli.list \
3437
&& apt-get -y update -qq && apt-get -y install opensips-cli \
3538
;fi
3639

@@ -39,7 +42,7 @@ RUN if [ -n "${OPENSIPS_EXTRA_MODULES}" ]; then \
3942
apt-get -y install ${OPENSIPS_EXTRA_MODULES} \
4043
;fi
4144

42-
RUN rm -rf /var/lib/apt/lists/*
45+
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
4346
RUN sed -i "s/stderror_enabled=no/stderror_enabled=yes/g" /etc/opensips/opensips.cfg && \
4447
sed -i "s/syslog_enabled=yes/syslog_enabled=no/g" /etc/opensips/opensips.cfg
4548

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
NAME ?= opensips
2+
DEBIAN_RELEASE ?= bullseye
23
OPENSIPS_VERSION ?= 3.4
34
OPENSIPS_VERSION_MINOR ?=
4-
OPENSIPS_VERSION_REVISION ?=
5+
OPENSIPS_VERSION_REVISION ?= 1
56
OPENSIPS_BUILD ?= releases
67
OPENSIPS_COMPONENT ?=
78
OPENSIPS_DOCKER_TAG ?= latest
@@ -25,6 +26,7 @@ build:
2526
docker build \
2627
--no-cache \
2728
--target=$(DOCKER_TARGET) \
29+
--build-arg=DEBIAN_RELEASE=$(DEBIAN_RELEASE) \
2830
--build-arg=OPENSIPS_BUILD=$(OPENSIPS_BUILD) \
2931
--build-arg=OPENSIPS_VERSION=$(OPENSIPS_VERSION) \
3032
--build-arg=OPENSIPS_VERSION_MINOR=$(OPENSIPS_VERSION_MINOR) \

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ make build
1212
This command will build a docker image with OpenSIPS master version taken from
1313
the git repository. To build a different git version, you can run:
1414
```
15-
OPENSIPS_VERSION=2.2 make build
15+
OPENSIPS_VERSION=3.4 make build
1616
```
1717

1818
To build with MySQL support:
@@ -27,6 +27,7 @@ make start
2727

2828
## Variables
2929
You can set different variables to tune your deployment:
30+
* `DEBIAN_RELEASE` - sets the base image Debian release (Default: `bullseye`)
3031
* `OPENSIPS_VERSION` - sets the opensips version (Default: `3.4`)
3132
* `OPENSIPS_VERSION_MINOR` - forces a specific minor version of opensips (Default: not used, latest will be installed)
3233
* `OPENSIPS_VERSION_REVISION` - forces a specific revision/build of opensips; only taken into consideration if `OPENSIPS_VERSION_MINOR` is provided (Default: 1)

0 commit comments

Comments
 (0)