Build fails when tyring to use a custom source to image (s2i) on Openshift

Solution Verified - Updated -

Issue

The starting point is as follows:
- A template referencing a customized s2i existing in a Git repository
- This custom s2i image starts from the s2i-base-rhel7 image

# oc create -f my-s2i-app.yaml
# oc new-app --template=my-s2i-app

Build fails with the following error:

# oc logs -f my-s2i-app-1-build 
error: build error: image "registry.access.redhat.com/rhscl/s2i-base-rhel7@sha256:5ee732130640c99a89c50bcbe9c7ad2552234c1828f57f32cee59e44957a2446" must specify a user that is numeric and within the range of allowed users

The template has a BuildConfig definition like the following:

- apiVersion: v1
  kind: BuildConfig
  metadata:
    annotations:
      description: Defines how to build the application
    name: ${APPLICATION_NAME}
  spec:
    output:
      to:
        kind: ImageStreamTag
        name: ${APPLICATION_NAME}:latest
    source:
      contextDir: ""
      git:
        ref: "master"
        uri: "http://<git-repository-url>/my-s2i-definition.git"
      type: Git
    strategy:
      sourceStrategy:
        from:
          kind: ImageStreamTag
          name: s2i-base-rhel7:latest
      type: Source
    triggers:
    - type: ImageChange
    - type: ConfigChange

Environment

  • Openshift Container Platform 3.1+

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.