Skip to content

Instantly share code, notes, and snippets.

@csomh
Last active April 13, 2018 13:15
Show Gist options
  • Save csomh/3887c427b193b44ebaaa39dbf46ec8b9 to your computer and use it in GitHub Desktop.
Save csomh/3887c427b193b44ebaaa39dbf46ec8b9 to your computer and use it in GitHub Desktop.
Working with minishift

Docs

If on Fedora, RHEL one should use centos iso to make pushing to registry work
$ minishift start --iso-url centos

(can this be configured in a minishift profile to be used?)

Use docker deamon from minishift
$ eval $(minishift docker-env)
Use oc from minishift
$ eval $(minishift oc-env)
Log in to minishift cluster
$ oc config use-context minishift # to make oc use minishift context
$ oc login -u developer
<password is anything you want>
Login as administrator
$ oc login -u system:admin
Open the web console (in the default browser)
$ minishift console
Viewing images on host
$ minishift image list
View images in the VM
$ minishift image list --vm
Avoid switching to system:admin for operations which require this
$ oc <action> --as system:admin <object>
Export images from minishift to the host

This is especially handy when one has to delete and start minishift a lot. Images can be exported, so that they don't have to be rebuilt again in the new environment.

$ minishift image list --vm # to see images in minishift
$ minishift image export <image> # to export and image
$ minishift image list # to see images exported to the host
$ minishift image import <image> # to import an image back to minishift
Login to minishift Docker registry
$ docker login -u developer -p $(oc whoami -t) $(minishift openshift registry)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment