Create NCache Containers for Linux
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 edition.
Pull/Load NCache Docker Image
You can either pull the NCache image from Docker Hub or load the image if you have the image saved to your disk.
Execute the following command in a command line terminal to pull NCache Enterprise Server for Linux.
docker pull alachisoft/ncache:enterprise-server-linux-5.0
Follow this step if your image is saved on disk.
The Docker image needs to be imported before creating a container, if your image is saved on the disk. This is a one-time step.
docker load --input [path_to_tar_file]
Configure NCache Container
Before proceeding to create containers for NCache in Linux, you need to configure Macvlan network.
NCache Enterprise container is created in Evaluation trial mode for 10 days. You can activate NCache license once you purchase it.
Configure Macvlan Network
A Macvlan network driver assigns MAC address to each container’s virtual network interface, making it appear to be a physical network interface directly connected to the physical network.
Do make sure you have MAC address spoofing on, in case your host is a VM. To do this, run the command in PowerShell terminal on Hyper-V base:
Set-VMNetworkAdapter -VMName <hostVMName> -MacAddressSpoofing On
We will setup a Macvlan in Bridge mode. To set this up you can use the following command in Linux terminal:
sudo docker network create -d macvlan --subnet=188.8.131.52/24 --gateway=184.108.40.206 -o parent=eth0 McvlanNet
Create Container from Image
Once the NCache image is pulled and the Macvlan network is configured, you can create containers which host NCache and use them as cache servers.
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.
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 macvlan network created.
The following commands create the containers named
ncache-ent-server-02 in the shipped image
(alachisoft/ncache:enterprise-server-linux-5.0) using the default network. Note that the
dns value provided is the one in the subnet.
Make sure that the sequence of parameters provided is as follows.
sudo docker run --name=ncache-ent-server-01 --net=McvlanNet --ip=220.127.116.11 --dns=18.104.22.168 -itd alachisoft/ncache:enterprise-server-linux-5.0
sudo docker run --name=ncache-ent-server-02 --net=McvlanNet --ip=22.214.171.124 --dns=126.96.36.199 -itd alachisoft/ncache:enterprise-server-linux-5.0
Activate NCache License
NCache Enterprise is installed in Evaluation mode for 10 days. Once that period is up, you can purchase NCache licenses. To activate the license for NCache Docker on Linux, you need to do the following:
It is assumed you have obtained the license key from Alachisoft.
Change directory to
\opt\ncache\bin\activationwhile in the container’s command line.
Execute the following command:
./activate -f John -l Smith -e firstname.lastname@example.org -k XXXXXXXXX-XXXXXX-XXXXXXXX
This activates the license for John Smith, using the provided license key.
For more details, you can refer to documentation on command line license activation here.