forked from jccardonar/NetFlow-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github: generate a simple flowgen container
Build and publish a simple flowgen container.
- Loading branch information
Showing
2 changed files
with
50 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,40 @@ | ||
name: docker-publish-ghcr | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
|
||
permissions: | ||
packages: write | ||
|
||
env: | ||
PLATFORMS: linux/amd64 | ||
|
||
jobs: | ||
docker_build_and_publish: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: "Checkout netflow-generator" | ||
uses: actions/checkout@v4 | ||
with: | ||
path: netflow-generator | ||
fetch-depth: 0 | ||
fetch-tags: 1 | ||
|
||
- name: "Set up Docker buildx" | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: "Login to GitHub Container Registry (ghcr.io)" | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.actor}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: "Build and push to ghcr" | ||
run: | | ||
#Cross-build | ||
cd netflow-generator | ||
export TAG=$(git describe HEAD | sed 's/-.*$//g') | ||
docker buildx build --platform ${PLATFORMS} --push -f Dockerfile . --tag ghcr.io/${GITHUB_REPOSITORY}:${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,10 @@ | ||
#### Base Image: Debian 12 (Bookworm) | ||
FROM debian:bookworm-slim as builder | ||
|
||
RUN apt-get update && apt-get -y install gcc make | ||
COPY * /tmp/ | ||
RUN cd tmp && make && ls -la | ||
|
||
FROM debian:bookworm-slim | ||
COPY --from=builder /tmp/flowgen /usr/bin/ | ||
ENTRYPOINT ["/usr/bin/flowgen"] |