Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
FROM golang:1.26-alpine AS builder
# golang:1.26-alpine
FROM golang@sha256:0178a641fbb4858c5f1b48e34bdaabe0350a330a1b1149aabd498d0699ff5fb2 AS builder

ARG VERSION
ARG SCANNER_IMG_VERSION
ARG SNIFFER_IMG_VERSION

COPY . /build
WORKDIR /build
Expand All @@ -9,7 +12,8 @@ RUN go mod download && \
CGO_ENABLED=0 GO111MODULE=on go build -ldflags="-X 'main.appName=NetAssert' -X 'main.version=${VERSION}' -X 'main.scannerImgVersion=${SCANNER_IMG_VERSION}' -X 'main.snifferImgVersion=${SNIFFER_IMG_VERSION}'" -v -o /netassertv2 cmd/netassert/cli/*.go && \
ls -ltr /netassertv2

FROM gcr.io/distroless/base:nonroot
# gcr.io/distroless/base:nonroot
FROM gcr.io/distroless/base@sha256:97b9d04bed1c754b756c3c4b6a04915c22fb0b5d96a59944eb3bf78c26e6e157
COPY --from=builder /netassertv2 /usr/bin/netassertv2

ENTRYPOINT [ "/usr/bin/netassertv2" ]
13 changes: 6 additions & 7 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ calico-apply:
calico-rm-apply:
kubectl delete -f https://raw.githubusercontent.com/projectcalico/calico/v3.31.3/manifests/calico.yaml

# build docker image and tag it 0.0.01
docker-build:
docker build -f Dockerfile --no-cache --tag packet-capture:{{version}} .

# import image into the local kind cluster called packet-test
kind-import-image:
kind load docker-image packet-capture:{{version}} --name packet-test && kind load docker-image netassert-client:{{version}} --name packet-test

docker build -f Dockerfile \
--no-cache \
--build-arg VERSION={{version}} \
--build-arg SCANNER_IMG_VERSION=latest \
--build-arg SNIFFER_IMG_VERSION=latest \
--tag netassert-local:{{version}} .
Loading