Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-36630: Add hack Makefile target to build CI version of router image #612

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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
7 changes: 7 additions & 0 deletions hack/Makefile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ export GOOS=linux

REGISTRY ?= quay.io
IMAGE ?= openshift/openshift-router
IMAGE_BASE ?= openshift/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.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)
Expand Down