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.
Pull Image
Execute the following command in a command line terminal to pull NCache Enterprise Server for Linux.
docker pull alachisoft/ncache:enterprise-server-linux-4.9.1
Import Image
Important
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.
Note
NCache Enterprise container is created in Evaluation trial mode for 60 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.
Important
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=20.200.20.0/24 --gateway=20.200.20.1 -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.
The container can be created with either docker
run or docker
create command,
the difference being docker run
starts the container when it is 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.
Important
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-01
and
ncache-ent-server-02
in the shipped image
(alachisoft/ncache:enterprise-server-linux-4.9.1) using the default network. Note that the dns
value provided is the one in the subnet.
sudo docker run --name=ncache-ent-server-01 --net=McvlanNet --ip=20.200.20.201 --dns=20.200.20.10
-itd alachisoft/ncache:enterprise-server-linux-4.9.1
sudo docker run --name=ncache-ent-server-02 --net=McvlanNet --ip=20.200.20.202 --dns=20.200.20.10
-itd alachisoft/ncache:enterprise-server-linux-4.9.1
Activate NCache License
NCache Enterprise is installed in Evaluation mode for 60 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:
Important
It is assumed you have obtained the license key from Alachisoft.
Change directory to $NCHOME/bin/activation while in the container’s command line.
Execute the following command:
./activate -f John -l Smith -e john@alachisoft.com -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.
See Also
Use NCache on Docker
NCache Docker on Windows Server
NCache Docker on Nano Server