Skip to content

Instantly share code, notes, and snippets.

@soltysh
Last active March 9, 2017 14:06
Show Gist options
  • Save soltysh/91dff953c9fb42a9ec8063c449e272f6 to your computer and use it in GitHub Desktop.
Save soltysh/91dff953c9fb42a9ec8063c449e272f6 to your computer and use it in GitHub Desktop.

oc import-image

$ oc import-image busyboxx --confirm
The import completed with errors.

Name:			busyboxx
Namespace:		test
Created:		Less than a second ago
Labels:			<none>
Annotations:		openshift.io/image.dockerRepositoryCheck=2017-03-09T13:57:10Z
Docker Pull Spec:	172.30.89.51:5000/test/busyboxx
Unique Images:		0
Tags:			1

latest
  tagged from busyboxx

  ! error: Import failed (Unauthorized): you may not have access to the Docker image "busyboxx"
      Less than a second ago

oc create imagestream

btw. we lack here option to pass an image you want to create, which would be useful

$ oc create imagestream buxyboxxx
imagestream "buxyboxxx" created
$ oc describe is/buxyboxxx
Name:			buxyboxxx
Namespace:		test
Created:		18 seconds ago
Labels:			<none>
Annotations:		<none>
Docker Pull Spec:	172.30.89.51:5000/test/buxyboxxx
Tags:			<none>

oc create -f (1)

kind: ImageStream
apiVersion: v1
metadata: 
  name: python2
spec: 
  tags: 
  - name: latest
    from: 
      kind: DockerImage
      name: centos/python-30-centos7:latest
$ oc create -f is_python2.yaml 
imagestream "python2" created
$ oc describe is/python2
Name:			python2
Namespace:		test
Created:		4 seconds ago
Labels:			<none>
Annotations:		openshift.io/image.dockerRepositoryCheck=2017-03-09T14:00:28Z
Docker Pull Spec:	172.30.89.51:5000/test/python2
Unique Images:		0
Tags:			1

latest
  tagged from centos/python-30-centos7:latest

  ! error: Import failed (Unauthorized): you may not have access to the Docker image "centos/python-30-centos7:latest"
      Less than a second ago

oc create -f (2)

$ cat is.yaml 
apiVersion: v1
kind: ImageStream
metadata:
  name: python
spec:
  dockerImageRepository: buxybox 
$ oc create -f is.yaml 
imagestream "python" created
$ oc describe is/python
Name:			python
Namespace:		test
Created:		5 seconds ago
Labels:			<none>
Annotations:		openshift.io/image.dockerRepositoryCheck=2017-03-09T13:58:47Z
Docker Pull Spec:	172.30.89.51:5000/test/python
Tags:			<none>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment