Skip to content

Commit

Permalink
Fix builds with podman; align default tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak committed Sep 16, 2024
1 parent df4bbeb commit e0f1043
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export GOOS=linux
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= latest
VERSION ?= main
BUILD_DATE := $(shell date +%Y-%m-%d\ %H:%M)
TAG_COMMIT := $(shell git rev-list --abbrev-commit --tags --max-count=1)
TAG := $(shell git describe --abbrev=0 --tags ${TAG_COMMIT} 2>/dev/null || true)
Expand Down Expand Up @@ -60,7 +60,7 @@ FORCE: ;
# build a single arch target provided as argument
define build_target
echo 'building image for arch $(1)'; \
DOCKER_BUILDKIT=1 $(OCI_BIN) buildx build --load --build-arg TARGETPLATFORM=linux/$(1) --build-arg TARGETARCH=$(1) --build-arg BUILDPLATFORM=linux/amd64 ${OCI_BUILD_OPTS} -t ${IMAGE}-$(1) -f contrib/docker/Dockerfile .;
DOCKER_BUILDKIT=1 $(OCI_BIN) buildx build --load --build-arg TARGETARCH=$(1) ${OCI_BUILD_OPTS} -t ${IMAGE}-$(1) -f contrib/docker/Dockerfile .;
endef

# push a single arch target image
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -898,10 +898,10 @@ The `suppressGoMetrics` parameter may be set to `true` in order to suppress the
# compile project
make build
# build the default image (quay.io/netobserv/flowlogs-pipeline:latest):
# build the default image (quay.io/netobserv/flowlogs-pipeline:main):
make image-build
# push the default image (quay.io/netobserv/flowlogs-pipeline:latest):
# push the default image (quay.io/netobserv/flowlogs-pipeline:main):
make image-push
# build and push on your own quay.io account (quay.io/myuser/flowlogs-pipeline:dev):
Expand Down
9 changes: 3 additions & 6 deletions contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker
ARG TARGETPLATFORM=linux/amd64
ARG BUILDPLATFORM=linux/amd64
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.22 as builder
ARG TARGETARCH
FROM docker.io/library/golang:1.22 as builder

ARG TARGETPLATFORM
ARG TARGETARCH=amd64
WORKDIR /app

Expand All @@ -22,7 +19,7 @@ RUN git status --porcelain
RUN GOARCH=$TARGETARCH make build_code

# final stage
FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9/ubi-minimal:9.4
FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi-minimal:9.4

COPY --from=builder /app/flowlogs-pipeline /app/
COPY --from=builder /app/confgenerator /app/
Expand Down
2 changes: 1 addition & 1 deletion contrib/opentelemetry/flp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:
serviceAccountName: netobserv
containers:
- name: packet-counter
image: quay.io/netobserv/flowlogs-pipeline:latest
image: quay.io/netobserv/flowlogs-pipeline:main
ports:
- containerPort: 9999
hostPort: 9999
Expand Down
2 changes: 1 addition & 1 deletion docs/confGenerator.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Flags:
```
> Note: confgenerator is available also from `netobserv/flowlogs-pipeline` quay image. To use execute:
> `docker run --entrypoint /app/confgenerator quay.io/netobserv/flowlogs-pipeline:latest --help`
> `docker run --entrypoint /app/confgenerator quay.io/netobserv/flowlogs-pipeline:main --help`
> Note: The default location for network definitions in flowlogs-pipeline is `/network_definitions` folder
Expand Down

0 comments on commit e0f1043

Please sign in to comment.