Skip to content

Commit

Permalink
Create docker image for SIPssert. (#24)
Browse files Browse the repository at this point in the history
* Add docker image + workflow for pushing image.

* Correct context for docker-image.yml.
  • Loading branch information
dariusstefan authored Aug 2, 2024
1 parent e6f9614 commit 1d4ea60
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Push SIPssert Docker Image in Docker Hub

on:
push:
workflow_dispatch:

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Set docker-tag variable
run: BRANCH="${GITHUB_REF#refs/heads/}"; echo -e "BRANCH=$BRANCH\nDOCKER_TAG=${BRANCH//main/latest}" >> $GITHUB_ENV

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./docker
push: true
tags: opensips/sipssert:${{ env.DOCKER_TAG }}
13 changes: 13 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.12-bookworm
LABEL maintainer="darius.stefan@opensips.org"

RUN apt update && apt install -y tcpdump &&\
pip install --upgrade pip &&\
pip install pyyaml &&\
git clone https://github.com/OpenSIPS/SIPssert.git &&\
cd SIPssert &&\
python3 setup.py install &&\
cd ..

ENTRYPOINT ["sipssert"]

15 changes: 15 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Docker Image for SIPssert

This image can be used to run the SIPssert tool for a test set provided by the user.
Build the image with the following command:

```bash
docker build -t opensips/sipssert .
```

Due to the fact that the SIPssert containers are actually started from the host environment, we need to provide the host's relative path to the scenarios. Since this is unknown in the SIPssert's container environment, we need match the exact host's filesystem layout for the tests directory.
So, go to your test directory and run the following command:

```bash
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):$(pwd) -w $(pwd) opensips/sipssert .
```

0 comments on commit 1d4ea60

Please sign in to comment.