-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create docker image for SIPssert. (#24)
* Add docker image + workflow for pushing image. * Correct context for docker-image.yml.
- Loading branch information
1 parent
e6f9614
commit 1d4ea60
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3.12-bookworm | ||
LABEL maintainer="[email protected]" | ||
|
||
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"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . | ||
``` |