Uploaded image for project: 'OpenShift Builds'
  1. OpenShift Builds
  2. BUILD-336

"s2i generate" generates an unusable base image ( "FROM") directive

XMLWordPrintable

      Steps to reproduce:

      docker run -w=/tmp  -v=/Users/sbose/openshiftconsole/src/github.com/openshift/console/frontend:/tmp  registry.redhat.io/ocp-tools-43-tech-preview/source-to-image-rhel8 generate docker://docker.io/centos/nodejs-10-centos7 Dockerfile.gen
      

      OR

      s2i generate docker://docker.io/centos/nodejs-10-centos7 Dockerfile.gen
      

      generates Dockerfile.gen ( see below ) which has a FROM docker://docker.io/centos/nodejs-10-centos7 directive.
      On trying to build from the Dockerfile, you would see get an error "Step 1/8 : FROM docker://docker.io/centos/nodejs-10-centos7 invalid reference format"

      FROM docker://docker.io/centos/nodejs-10-centos7
      LABEL "io.openshift.s2i.build.image"="docker://docker.io/centos/nodejs-10-centos7" \
            "io.openshift.s2i.scripts-url"="image:///usr/libexec/s2i"
      
      USER root
      # Copying in source code
      COPY upload/src /tmp/src
      # Change file ownership to the assemble user. Builder image must support chown command.
      RUN chown -R 1001:0 /tmp/src
      USER 1001
      # Assemble script sourced from builder image based on user input or image metadata.
      # If this file does not exist in the image, the build will fail.
      RUN /usr/libexec/s2i/assemble
      # Run script sourced from builder image based on user input or image metadata.
      # If this file does not exist in the image, the build will fail.
      CMD /usr/libexec/s2i/run
      
      

      Expected output

      Should have "FROM docker.io/centos/nodejs-10-centos7" without the "docker://"

      FROM docker.io/centos/nodejs-10-centos7
      LABEL "io.openshift.s2i.build.image"="docker://docker.io/centos/nodejs-10-centos7" \
            "io.openshift.s2i.scripts-url"="image:///usr/libexec/s2i"
      
      USER root
      # Copying in source code
      COPY upload/src /tmp/src
      # Change file ownership to the assemble user. Builder image must support chown command.
      RUN chown -R 1001:0 /tmp/src
      USER 1001
      # Assemble script sourced from builder image based on user input or image metadata.
      # If this file does not exist in the image, the build will fail.
      RUN /usr/libexec/s2i/assemble
      # Run script sourced from builder image based on user input or image metadata.
      # If this file does not exist in the image, the build will fail.
      CMD /usr/libexec/s2i/run
      
      

              isuttonl Igor Sutton (Inactive)
              shbose Shoubhik Bose
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: