Skip to content

Commit

Permalink
Use public images in our Dockerfile by default
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Ropé <[email protected]>
  • Loading branch information
littlejawa committed Jan 23, 2025
1 parent 3289a30 commit dea2207
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Use OpenShift golang builder image
# These images needs to be synced with the images in the Makefile.
ARG BUILDER_IMAGE=${BUILDER_IMAGE:-registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.17}
ARG TARGET_IMAGE=${TARGET_IMAGE:-registry.ci.openshift.org/ocp/4.17:base-rhel9}
FROM ${BUILDER_IMAGE} AS builder
FROM registry.access.redhat.com/ubi9/go-toolset:1.22.7 AS builder

WORKDIR /workspace

Expand All @@ -24,7 +22,7 @@ RUN go mod vendor
RUN make build

# Use OpenShift base image
FROM ${TARGET_IMAGE}
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
WORKDIR /
COPY --from=builder /workspace/bin/manager .
COPY --from=builder /workspace/bin/metrics-server .
Expand Down
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ else
GOBIN=$(shell go env GOBIN)
endif

# These images needs to be synced with the default values in the Dockerfile.
BUILDER_IMAGE ?= registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.17
TARGET_IMAGE ?= registry.ci.openshift.org/ocp/4.17:base-rhel9
# CONTAINER_TOOL defines the container tool to be used for building images.
# Be aware that the target commands are only tested with Docker which is
# scaffolded by default. However, you might want to replace it to use other
Expand Down Expand Up @@ -156,8 +153,6 @@ run: manifests generate fmt vet ## Run a controller from your host.
docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build \
-t ${IMG} \
--build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
--build-arg TARGET_IMAGE=$(TARGET_IMAGE) \
.

.PHONY: docker-push
Expand All @@ -180,8 +175,6 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
- $(CONTAINER_TOOL) buildx build --push \
--platform=$(PLATFORMS) \
--tag ${IMG} \
--build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
--build-arg TARGET_IMAGE=$(TARGET_IMAGE) \
-f Dockerfile.cross \
.
- $(CONTAINER_TOOL) buildx rm project-v3-builder
Expand Down
12 changes: 0 additions & 12 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ In summary:
- log in from the command line with the provided command
- use "oc registry login" to save the token locally

### Using public images

If you cannot login to registry.ci.openshift.org, a temporary solution is to use
public images during build and test. At the time of writing, the following public images
does the trick.

```shell
export BUILDER_IMAGE=registry.ci.openshift.org/openshift/release:golang-1.22
export TARGET_IMAGE=registry.ci.openshift.org/origin/4.17:base-rhel9
make docker-build
```

## Set Environment Variables

Set your quay.io userid
Expand Down

0 comments on commit dea2207

Please sign in to comment.