https://github.com/openshift/origin/blob/master/docs/cluster_up_down.md
step: 1 install Docker and set "insecure-registry"
Install Docker for Mac making sure you meet the prerequisites and download a compatible version of Docker.
172.30.0.0/16
:1. From the Docker menu in the toolbar, select
2. "Preferences..."
3. Click on "Daemon"
4. In the preferences dialog
(note: on some older versions of Docker for Mac this is under "Advanced")
5. Under "Insecure registries":
6. click on the "+", icon to add a new entry, Enter "172.30.0.0/16" and press "return"
7. Click on "Apply and Restart"
Here is the example (step 1-3)
Here is the example (step 4-7)
Install the openshift.
Install the oc binary using homebrew with:brew install openshift-cli
OR
Download the OS Xoc
binary fromopenshift-origin-client-tools-VERSION-mac.zipand place it in your path.
Please be aware that the 'oc cluster' set of commands are only available in the 1.3+ or newer releases.
Create a new docker machine namedopenshift
with appropriate resource constraints. SeeGetting Started with Docker Machinefor instructions.
Open Terminal and run
$ docker-machine create openshift
$ docker-machine start openshift
To start/stop OpenShift cluster:
Setup the Docker environment for the machine you wish to use, and then runoc cluster up
andoc cluster down
:
$ eval $(docker-machine env openshift)
$ oc cluster up
...
$ oc cluster down
if you receive the following error, when run "oc cluster up ", please make you setup the "insecure registry" in step 1 and restarted your docker.
Ensure that the Docker daemon is running with the following argument:
--insecure-registry 172.30.0.0/16
if you check the docker container such as run "docker container ls" , you will find 4 containers are running:
docker container ls
The container name :
- router
- registry_docker
- webconsole
- origin
run "oc cluster up ".
open the "browser" and default URL :
Default URL :
Default username and password
admin /password
After login, you can try the local "Openshift" for your development, enjoy
Remark:
useful oc command
$ oc cluster status
$ oc config view
official document:
https://docs.openshift.com/enterprise/3.0/cli_reference/get_started_cli.html
To persist data across restarts, specify a valid host directory in the--host-data-dir
argument when starting your cluster withoc cluster up
. As long as the same value is specified every time, the data will be preserved across restarts.
If a host data directory is not specified, the data directory used by OpenShift is discarded when the container is destroyed.
# Start OpenShift on a new docker machine named 'openshift'
oc cluster up --create-machine
# Start OpenShift using a specific public host name
oc cluster up --public-hostname=my.address.example.com
# Start OpenShift and preserve data and config between restarts
oc cluster up --host-data-dir=/mydata --use-existing-config
oc cluster up --host-data-dir=/usr/local/docker/mydata --use-existing-config
To persist data across restarts.
Step 1 : set the docker "File Sharing"
Step 2 : run the cluster up with "host data"
oc cluster up --host-data-dir=/usr/local/docker/openshift/mydata --use-existing-config