diff --git a/HACKING.md b/HACKING.md index 758d0ba58..377324a27 100644 --- a/HACKING.md +++ b/HACKING.md @@ -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 diff --git a/hack/Makefile.debug b/hack/Makefile.debug index cc48b3fcd..f09d31944 100644 --- a/hack/Makefile.debug +++ b/hack/Makefile.debug @@ -4,6 +4,7 @@ export GOOS=linux REGISTRY ?= quay.io IMAGE ?= openshift/openshift-router +IMAGE_BASE ?= openshift/openshift-router-base TAG ?= latest IMAGEBUILDER ?= podman @@ -11,6 +12,12 @@ 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.tmp + sed -i "s|FROM .*|FROM $(IMAGE_BASE):$(TAG)|" images/router/haproxy/Dockerfile.ocp.tmp + $(IMAGEBUILDER) build -t $(IMAGE):$(TAG) -f images/router/haproxy/Dockerfile.ocp.tmp . + push: $(IMAGEBUILDER) tag $(IMAGE):$(TAG) $(REGISTRY)/$(IMAGE):$(TAG) $(IMAGEBUILDER) push $(REGISTRY)/$(IMAGE):$(TAG)