forked from vmware/go-ipfix
-
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.
Add docker image for ipfix-collector
Also add github workflow to push to harbor registry.
- Loading branch information
1 parent
5232302
commit 0552af4
Showing
4 changed files
with
82 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,31 @@ | ||
name: Build and push the latest image if needed | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- release-* | ||
push: | ||
branches: | ||
- master | ||
- release-* | ||
|
||
jobs: | ||
build: | ||
if: ${{ github.event_name == 'push' }} | ||
runs-on: [ubuntu-18.04] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build ipfix-collector Docker image | ||
run: | | ||
make collector | ||
make docker-collector | ||
- name: Push ipfix-collector Docker image to harbor registry | ||
if: ${{ github.repository == 'vmware/go-ipfix' && github.event_name == 'push' && github.ref == 'refs/heads/master' }} | ||
env: | ||
HARBOR_REGISTRY: ${{ secrets.HARBOR_REGISTRY }} | ||
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }} | ||
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }} | ||
run: | | ||
echo "$HARBOR_PASSWORD" | docker login -u "$HARBOR_USERNAME" --password-stdin $HARBOR_REGISTRY | ||
docker push goipfix/ipfix-collector:latest |
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,24 @@ | ||
name: Build and push a release image | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build: | ||
runs-on: [ubuntu-18.04] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build go-ipfix Docker images and push to harbor registry | ||
env: | ||
HARBOR_REGISTRY: ${{ secrets.HARBOR_REGISTRY }} | ||
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }} | ||
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }} | ||
TAG: ${{ github.ref }} | ||
run: | | ||
make collector | ||
make docker-collector | ||
echo "$HARBOR_PASSWORD" | docker login -u "$HARBOR_USERNAME" --password-stdin $HARBOR_REGISTRY | ||
docker tag goipfix/ipfix-collector goipfix/ipfix-collector:"${TAG:10}" | ||
docker push goipfix/ipfix-collector:"${TAG:10}" |
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
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,21 @@ | ||
FROM golang:1.15 as go-ipfix-build | ||
|
||
WORKDIR /go-ipfix | ||
|
||
COPY go.mod /go-ipfix/go.mod | ||
|
||
RUN go mod download | ||
|
||
COPY . /go-ipfix | ||
|
||
RUN make collector | ||
|
||
|
||
FROM antrea/base-ubuntu:2.14.0 | ||
|
||
FROM ubuntu:18.04 | ||
|
||
LABEL maintainer="go-ipfix" | ||
LABEL description="A Docker image based on Ubuntu 18.04 which contains a IPFIX collector" | ||
|
||
COPY --from=go-ipfix-build /go-ipfix/bin/collector /usr/local/bin/ |