Added docker build&push to the CI.

* update some git submodules

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2023-08-03 08:36:19 +02:00
parent 0e31829401
commit 7b15838696
5 changed files with 30 additions and 15 deletions

25
.github/workflows/build-docker.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Docker Build
on:
push:
branches:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: utoni/ndpid:latest

View File

@@ -1,15 +1,10 @@
FROM ubuntu:22.10 as builder
WORKDIR /root
RUN apt-get -y update && apt-get install -y git cmake pkg-config libpcap-dev autoconf libtool
RUN env DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get install -y wget unzip git make cmake pkg-config libpcap-dev autoconf libtool
RUN git clone https://github.com/utoni/nDPId.git
#for dev, uncomment below
#RUN mkdir /root/nDPId
#COPY . /root/nDPId/
RUN cd nDPId && mkdir build && cd build && cmake .. -DBUILD_NDPI=ON && make
RUN cd nDPId && mkdir -p build && cd build && cmake .. -DBUILD_NDPI=ON && make
FROM ubuntu:22.10
WORKDIR /root
@@ -17,9 +12,3 @@ RUN apt-get -y update && apt-get -y install libpcap-dev
COPY --from=builder /root/nDPId/libnDPI/ /root/
COPY --from=builder /root/nDPId/build/nDPIsrvd /root/nDPId/build/nDPId /root/
#RUN echo "#!/bin/bash\n" \
# "/root/nDPIsrvd -d\n"\
# "/root/nDPId \n" > run.sh && cat run.sh && chmod +x run.sh
#ENTRYPOINT ["/root/run.sh"]

View File

@@ -1,6 +1,7 @@
[![Build](https://github.com/utoni/nDPId/actions/workflows/build.yml/badge.svg)](https://github.com/utoni/nDPId/actions/workflows/build.yml)
[![Gitlab-CI](https://gitlab.com/utoni/nDPId/badges/main/pipeline.svg)](https://gitlab.com/utoni/nDPId/-/pipelines)
[![Circle-CI](https://circleci.com/gh/utoni/nDPId.svg?style=shield "Circle-CI")](https://app.circleci.com/pipelines/github/utoni/nDPId)
![Docker Automated build](https://img.shields.io/docker/automated/utoni/ndpid)
# References