Although Openshift is able to use docker images, it has much more restrictions. Thus not all docker images can work straight on Openshift. Unfortunately, the official nginx docker image does not work on openshift.
In this post, I will simply go through how to run this Official RedHat nginx image on Openshift and deploy a website onto it.
Using XMLHTTPRequest (ajax) transporting data between client and server has been popular for a while. Sometimes, we want our browser to retrieve binary data from server (as ArrayBuffer or Blob) such as pdf, image, and psd files. This post will go through how to achieve it with XMLHTTPRequest and jQuery.
Taking screenshots with MacOSX is very useful when writting blogs or documents. The system has powerful built-in screenshot function. However, the default location to store the screenshot files is Desktop.
This blog will go through how to change the location of screenshots to another folder.
Step 1 Create a folder
Create a new folder anywhere using finder or terminal. Here I created blog_statics folder in my Google Drive folder.
Step 2 Change default location of screenshots
Click the created folder in last step and press Command+C to copy the full path to clipboard.
Press Command + Space and type terminal to open terminal
To create an overlay network on multiple hosts over swarm, following are required:
a key-value store service: this is used for broadcasting hosts / swarm agents. It can be same kv store swarm used for discovery
Run docker daemon with following parameters:
cluster-store: where the store is
cluster-advertise: what network interface to be advertised
Setup consul KV store
docker run -d \
-p "8500:8500" \
-h "consul" \
progrium/consul -server -bootstrap
--engine-opt="cluster-store=consul://$(docker-machine ip mh-keystore):8500"
All swarm-agents should have these options otherwise it will be likely get this error:
Errorresponse from daemon: 500 Internal ServerError: failed to parse pool requestfor address space"GlobalDefault" pool "" subpool "": cannot find address space GlobalDefault (most likely the backing datastore isnot configured)
Create overlay network
If using docker-compose, there is nothing need to do. As docker-compose will automatically create defaul network if:
Single host: it will create a bridge
Multiple host: it will create a overlay
Once docker-compose file finished, just run docker-compose up -d which will create network correspondingly.
otherwise simply use following command at your swarm: