Skip to content

Commit a1e3f27

Browse files
Update image
1 parent 5196141 commit a1e3f27

File tree

7 files changed

+113
-33
lines changed

7 files changed

+113
-33
lines changed

.github/workflows/docker-image.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Docker Publisch Consumer CI
2+
3+
on:
4+
schedule:
5+
- cron: '42 11 * * *'
6+
push:
7+
branches: [ "main" ]
8+
# Publish semver tags as releases.
9+
tags: [ 'v*.*.*' ]
10+
pull_request:
11+
branches: [ "main" ]
12+
13+
env:
14+
REGISTRY: docker.io
15+
IMAGE_NAME: stefan96/heidpi-consumer
16+
17+
18+
jobs:
19+
build:
20+
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
packages: write
25+
# This is used to complete the identity challenge
26+
# with sigstore/fulcio when running outside of PRs.
27+
id-token: write
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v3
32+
33+
# Install the cosign tool except on PR
34+
# https://github.com/sigstore/cosign-installer
35+
- name: Install cosign
36+
if: github.event_name != 'pull_request'
37+
uses: sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 #v2.6.0
38+
with:
39+
cosign-release: 'v1.13.1'
40+
41+
42+
# Workaround: https://github.com/docker/build-push-action/issues/461
43+
- name: Setup Docker buildx
44+
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
45+
46+
# Login against a Docker registry except on PR
47+
# https://github.com/docker/login-action
48+
- name: Log into registry ${{ env.REGISTRY }}
49+
if: github.event_name != 'pull_request'
50+
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
51+
with:
52+
registry: ${{ env.REGISTRY }}
53+
username: ${{ secrets.DOCKER_USERNAME }}
54+
password: ${{ secrets.DOCKER_PASSWORD }}
55+
56+
# Extract metadata (tags, labels) for Docker
57+
# https://github.com/docker/metadata-action
58+
- name: Extract Docker metadata
59+
id: meta
60+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
61+
with:
62+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
63+
64+
# Build and push Docker image with Buildx (don't push on PR)
65+
# https://github.com/docker/build-push-action
66+
- name: Build and push Docker image
67+
id: build-and-push
68+
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
69+
with:
70+
context: .
71+
push: ${{ github.event_name != 'pull_request' }}
72+
tags: ${{ steps.meta.outputs.tags }}
73+
labels: ${{ steps.meta.outputs.labels }}
74+
file: ./Dockerfile.producer
75+
cache-from: type=gha
76+
cache-to: type=gha,mode=max
77+
78+
- name: Docker Hub Description
79+
uses: peter-evans/dockerhub-description@v3
80+
with:
81+
username: ${{ secrets.DOCKER_USERNAME }}
82+
password: ${{ secrets.DOCKER_PASSWORD }}
83+
repository: ${{ env.IMAGE_NAME }}
84+
short-description: ${{ github.event.repository.description }}
85+
86+
87+
# Sign the resulting Docker image digest except on PRs.
88+
# This will only write to the public Rekor transparency log when the Docker
89+
# repository is public to avoid leaking data. If you would like to publish
90+
# transparency data even for private images, pass --force to cosign below.
91+
# https://github.com/sigstore/cosign
92+
- name: Sign the published Docker image
93+
if: ${{ github.event_name != 'pull_request' }}
94+
env:
95+
COSIGN_EXPERIMENTAL: "true"
96+
# This step uses the identity token to provision an ephemeral certificate
97+
# against the sigstore community Fulcio instance.
98+
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}

.github/workflows/docker-publish.yml renamed to .github/workflows/docker-publish-producer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker Publisch CI
1+
name: Docker Publisch Producer CI
22

33
on:
44
schedule:

Dockerfile.producer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN apk update && \
2121

2222
RUN git clone https://github.com/utoni/nDPId.git
2323

24-
COPY config.h nDPId
24+
COPY nDPId/config.h nDPId
2525

2626
RUN cd nDPId && mkdir build && cd build && cmake .. -DBUILD_NDPI=ON && make
2727

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
[![Build](https://github.com/stefanDeveloper/heidpi/actions/workflows/docker-image.yml/badge.svg)](https://github.com/stefanDeveloper/heidpi/actions/workflows/docker-image.yml) [![GitHub Stars](https://img.shields.io/github/stars/stefanDeveloper/heidpi)](https://github.com/stefanDeveloper/heidpi/) [![Docker Pulls](https://img.shields.io/docker/pulls/stefan96/heidpi.svg)](https://hub.docker.com/r/stefan96/heidpi/) ![Docker Stars](https://img.shields.io/docker/stars/stefan96/heidpi)
1+
2+
[![Build](https://github.com/stefanDeveloper/heidpi/actions/workflows/docker-publish-producer.yml/badge.svg)](https://github.com/stefanDeveloper/heidpi/actions/workflows/docker-publish-producer.yml) [![GitHub Stars](https://img.shields.io/github/stars/stefanDeveloper/heidpi)](https://github.com/stefanDeveloper/heidpi/) [![Docker Pulls](https://img.shields.io/docker/pulls/stefan96/heidpi-producer.svg)](https://hub.docker.com/r/stefan96/heidpi-producer/) ![Docker Stars](https://img.shields.io/docker/stars/stefan96/heidpi-producer)
3+
4+
5+
[![Build](https://github.com/stefanDeveloper/heidpi/actions/workflows/docker-publish-consumer.yml/badge.svg)](https://github.com/stefanDeveloper/heidpi/actions/workflows/docker-publish-consumer.yml) [![GitHub Stars](https://img.shields.io/github/stars/stefanDeveloper/heidpi)](https://github.com/stefanDeveloper/heidpi/) [![Docker Pulls](https://img.shields.io/docker/pulls/stefan96/heidpi-consumer.svg)](https://hub.docker.com/r/stefan96/heidpi-consumer/) ![Docker Stars](https://img.shields.io/docker/stars/stefan96/heidpi-consumer)
26

37

48
# heidpi - nDPId Docker Image
@@ -22,15 +26,15 @@ In order to run this container you'll need docker installed.
2226
Pull images:
2327

2428
```sh
25-
docker pull stefan96/heidpi:producer-latest
26-
docker pull stefan96/heidpi:consumer-latest
29+
docker pull stefan96/heidpi-producer:main
30+
docker pull stefan96/heidpi-consumer:main
2731
```
2832

2933
Run producer and consumer separately from each other using UDP socket:
3034

3135
```sh
32-
docker run -p 127.0.0.1:7000:7000 --net host stefan96/heidpi:producer-latest
33-
docker run -e HOST=127.0.0.1 --net host stefan96/heidpi:consumer-latest
36+
docker run -p 127.0.0.1:7000:7000 --net host stefan96/heidpi-producer:main
37+
docker run -e HOST=127.0.0.1 --net host stefan96/heidpi-consumer:main
3438
```
3539

3640
or use the `docker-compose.yml`:
@@ -42,8 +46,8 @@ docker-compose up
4246
Additionally, you use a UNIX socket:
4347

4448
```sh
45-
docker run -v ${PWD}/heidpi-data:/tmp/ --net host stefan96/heidpi:producer-latest
46-
docker run -v ${PWD}/heidpi-data:/tmp/ -v ${PWD}/heidpi-logs:/var/log -e UNIX=/tmp/nDPIsrvd-daemon-distributor.sock --net host stefan96/heidpi:consumer-latest
49+
docker run -v ${PWD}/heidpi-data:/tmp/ --net host stefan96/heidpi-producer:main
50+
docker run -v ${PWD}/heidpi-data:/tmp/ -v ${PWD}/heidpi-logs:/var/log -e UNIX=/tmp/nDPIsrvd-daemon-distributor.sock --net host stefan96/heidpi-consumer:main
4751
```
4852

4953
## Environment Variables

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
version: "3.9"
22
services:
33
consumer:
4-
image: stefan96/heidpi:consumer-latest
4+
image: stefan96/heidpi-consumer:main
55
volumes:
66
- ${PWD}/heidpi-data:/var/log/
77
network_mode: host
88
depends_on:
99
- producer
1010
producer:
11-
image: stefan96/heidpi:producer-latest
11+
image: stefan96/heidpi-producer:main
1212
network_mode: host

config.h renamed to nDPId/config.h

File renamed without changes.

0 commit comments

Comments
 (0)