Create NCache Containers for Windows Server
Once you have set your Docker environment, you can now proceed to create containers for NCache Cache Server images hosted on Docker Hub for Enterprise, Professional and Open Source editions.
Pull Docker Image
Execute the following command in Windows PowerShell or a shell of your choice to pull NCache Open Source Server for Windows.
docker pull alachisoft/ncache:opensource-server-4.9.1
Configure Transparent Network
Transparent network uses IPs from host network and each container is assigned a separate virtual NIC. This network best suits network configuration needed for NCache. Each container acts as a separate node and can communicate across hosts on the same network, meaning that the NCache cluster can be managed anywhere from that network. Containers attached to a network created with the transparent driver will be directly connected to the physical network. IPs from physical network can be assigned statically or dynamically.
The following docker network create command creates a transparent network called transNet which contains subnet 126.96.36.199/24 and specifies the gateway as 188.8.131.52. You can change the values according to your own environment.
docker network create -d transparent --subnet=184.108.40.206/24 --gateway=220.127.116.11 transNet
Create Container from Image
Once the NCache image is pulled and the network is configured as transparent, you can create containers which host NCache and use them as cache servers.
It is highly recommended to use static IPs for each container as all future connections will take place using this IP. These IPs should exist in the IP range specified in the transparent network created.
Note that while creating containers, the image specified should exist locally. If not, the image is then fetched from Docker Hub if the name of the repository is specified.
NCache Open Source container is free to use as is.
The following commands create the containers named
ncache-oss-server-02 in the shipped image
(alachisoft/ncache:opensource-server-4.9.1) in detached mode using the configured
mac-address is a compulsory parameter. Failing to provide it will return in license activation being lost in case of container restart. This is a Docker limitation.
docker run -d --name=ncache-oss-server-01 --net=transNet --ip=18.104.22.168 --mac-address="xx:xx:xx:xx:xx:xx" alachisoft/ncache:opensource-server-4.9.1
docker run -d --name=ncache-oss-server-02 --net=transNet --ip=22.214.171.124 --mac-address="xx:xx:xx:xx:xx:xx" alachisoft/ncache:opensource-server-4.9.1