<p>I am building an OpenShift s2i image. And to help streamline development I would like to create an image stream based on this s2i image, so that I can quickly test if changes to the s2i - and if changes in the source code base - works.</p>

<p>I cannot find any <code>oc</code> command to create a new image stream.</p>

<p>I tried to create an image stream using the below yml. </p>

<pre><code>kind: "BuildConfig"
apiVersion: "v1"
metadata:
  name: "s2i-cpp" 
  annotations:
    openshift.io/build-config.name: s2i-cpp
  labels:
    build: s2i-cpp
    buildconfig: s2i-cpp
    openshift.io/build-config.name: s2i-cpp
    openshift.io/build.start-policy: Serial
spec:
  source:
    contextDir: "dockerfiles/builder"
    git:
      ref: master
      uri: 'https://gitlab.com/myrepo/s2i-cpp-wine.git'
    sourceSecret:
      name: gitlab-priceinsight
    type: Git
  strategy:
   type: Docker
   dockerStrategy:
    dockerfilePath: dockerfiles/builder/
  output: 
    to:
      kind: "ImageStreamTag"
      name: "s2i-cpp:latest"
</code></pre>

<p>While I am able to create this using <code>oc create -f imagestream.yml</code>, when I try to run this, it immediately errors with <code>Invalid output reference</code>. My expectation was that it would create a new image.</p>

<h3>Move to project namescape or use -n</h3>

<pre><code>oc project &lt;your namespace&gt;
</code></pre>

<h3>Create a imagestream using cli</h3>

<pre><code>oc create imagestream &lt;image-name&gt;
</code></pre>

<p>Image streamname should be same as in yaml file</p>

<pre><code>output:
    to:
      kind: ImageStreamTag
      name: 'image-name:latest'
</code></pre>

<h3>Create build using yaml file</h3>

<pre><code>oc create -f &lt;build&gt;.yaml
</code></pre>
