S2I Build is unable to pull or push to the internal OpenShift Registry
Issue
When running a Build in OpenShift, the build Pod is unable to pull and/or push images to/from the internal OpenShift Registry.
The BuildConfig includes an environment variable override similar to the following:
sourceStrategy:
...
env:
- name: NO_PROXY
value: artifactory.XXX.XXX.XX
An error similar to the following errors is displayed in the Builder Pod:
Example 1
error: build error: Failed to push image: trying to reuse blob sha256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX at destination: pinging container registry image-registry.openshift-image-registry.svc:5000: invalid status code from registry 403 (Forbidden)
Example 2
Warning: Pull failed, retrying in 5s ...
Trying to pull
image-registry.openshift-image-registry.svc:5000/openshift/XXXXXX...
...
error: build error: After retrying 2 times, Pull image sti...svc:5000:
invalid status code from registry 403 (Forbidden)
Environment
- OpenShift 4.x
- Cluster Proxy is defined
- A
NO_PROXYvalue is set in the BuildConfig used by S2I
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.