Skip to content

Commit

Permalink
OCPBUGS-36630: Add hack Makefile target to build CI version of router…
Browse files Browse the repository at this point in the history
… image
  • Loading branch information
alebedev87 committed Sep 5, 2024
1 parent 47b8420 commit 02bbc8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To test Router changes on an available cluster, utilize `Dockerfile.debug` and
`Makefile.debug` in `hack/`.

`Dockerfile.debug` is a multi-stage dockerifle for building the Router binary,
as well as the Router image itself. The outputted image uses `centos:8` as it's base
as well as the Router image itself. The outputted image uses `ubi9` as it's base
since installing packages on an OpenShift RHEL base image requires RHEL entitlements.

`Makefile.debug` contains simple commands for "hot-swapping" the Router image running
Expand Down
9 changes: 8 additions & 1 deletion hack/Makefile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
export GOOS=linux

REGISTRY ?= quay.io
IMAGE ?= openshift/openshift-router
IMAGE ?= $(USER)/openshift-router
IMAGE_BASE ?= $(USER)/openshift-router-base
TAG ?= latest
IMAGEBUILDER ?= podman

new-openshift-router-image:
GO111MODULE=on CGO_ENABLED=0 GOFLAGS=-mod=vendor go build -o openshift-router -gcflags=all="-N -l" ./cmd/openshift-router
$(IMAGEBUILDER) build -t $(IMAGE):$(TAG) -f hack/Dockerfile.debug .

new-ci-router-image:
$(IMAGEBUILDER) build -t $(IMAGE_BASE):$(TAG) -f images/router/base/Dockerfile.ocp .
cp -f images/router/haproxy/Dockerfile.ocp images/router/haproxy/Dockerfile.ocp.debug
sed -i "s|FROM .*|FROM $(IMAGE_BASE):$(TAG)|" images/router/haproxy/Dockerfile.ocp.debug
$(IMAGEBUILDER) build -t $(IMAGE):$(TAG) -f images/router/haproxy/Dockerfile.ocp.debug .

push:
$(IMAGEBUILDER) tag $(IMAGE):$(TAG) $(REGISTRY)/$(IMAGE):$(TAG)
$(IMAGEBUILDER) push $(REGISTRY)/$(IMAGE):$(TAG)
Expand Down

0 comments on commit 02bbc8e

Please sign in to comment.