Getting Started with Docker
Docker enables you to deliver software quickly by separating your applications from your infrastructure.
Thus, Docker acts as an “isolated, resource controlled, and portable operating environment” that can host any specific application on any machine without the hassle of deploying the environment manually.
NCache provides NCache Enterprise for Windows and Linux Server hosted on the Docker Hub. Once the Docker environment has been set, according to its prerequisites, you can pull the relevant images to start working on NCache.
Using these images, you can create containers that host NCache or create your own customized images by modifying the Dockerfiles.
NCache Docker Images on Docker Hub
The easiest and quickest way to start using NCache is to fetch a pre-built NCache Docker Image from Docker Hub. These Docker images come preinstalled with NCache. Simply use “docker pull” command to install them in your environment. To get started with Docker in NCache, follow the steps mentioned below:
- Install Docker.
- Verify the correct installation by using the following:
docker version
If you are unable to get the version number, check Docker Troubleshooting section.
- Pull the NCache Docker image from Docker Hub
docker pull alachisoft/ncache:latest
Start Docker Container
After pulling the Docker image, you must start a Docker container on the relevant box.
Server and Dev/QA Server
For a stable configuration and seamless integration, we strongly recommend utilizing the host network configuration for NCache deployments. This choice ensures that containers have direct access to the host's network interfaces and share the same IP and Mac address. Unlike the bridge network, which provides isolation between containers connected to the same network, the host network eliminates the need for explicit port mapping. Hence, bridge network is not recommended for NCache deployments.
Note
The NCache Docker container for NCache Server on Linux is set up through host mode networking, i.e., from the network's perspective, the applications inside the container are running on the host itself.
docker run --name ncache -itd --network host alachisoft/ncache:latest
Note
Please note that ncache
used in the command is the name of the container. You can choose any desired name for the container.
Dev Workstation
This allows developers to create a NCache container on their workstations for developing, debugging, and testing client applications. Run the following command using the host network:
docker run --name ncache itd --network host alachisoft/ncache:latest
Connect to Container
Once the NCache containers are created and running, you can access these containers by using docker exec command and specifying the container name of the newly created container.
Windows
The following command connects you to the container ncache using the docker exec command and opens a PowerShell instance within it.
docker exec -it ncache PowerShell
Linux
The following command connects you to the container ncache using the docker exec command:
docker exec -it ncache bash
Import NCache Tools Module (Windows)
If your PowerShell module is not automatically added to your system, you are required to import the NCache module so that NCache tools can be executed.
Note
NCache is installed by default at C:\Program Files\NCache in Windows.
Import-Module 'C:\Program Files\NCache\bin\tools\ncacheps'
Register NCache
In order to use NCache, you first need to register your Docker container. You can either register for free evaluation or activate NCache by selecting Activate with License Key.
Note
The default registration type for NCache is Cache Server, you can change this by updating the value of the RegisterAs
flag.
Note
To activate your NCache license, you need to have the license key from Alachisoft Sales.
Windows
Register NCache Using Installation Key
You need to specify the installation types through the RegisterAs
flag when registering a Docker container. The installation types can be Cache Server (default), Remote Client, or Developer. To do so, use the following command:
Register-NCacheEvaluation -Key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -FirstName John -LastName Smith -Email john@yourdomain.com -RegisterAs Developer -Company your_company_name
Register NCache with the Purchased License Key
You need to specify the registration type through the RegisterAs
flag when registering a Docker container. The registration types can be Cache Server, Remote Client, or Developer. To do so, use the following command:
Register-NCache -Key xxxxxxxxx-xxxxxx-xxxxxxxx -Environment Production -FirstName John -LastName Smith -Email john@yourdomain.com -RegisterAs Developer -Company your_company_name
Linux
Register NCache Using Installation Key
You need to specify the registration type through the registeras
flag when registering a Docker container. The registration types can be Cache Server, Remote Client, or Developer. To do so, use the following command:
Note
The "register-ncacheevaluation" command line tool is located in the $NCHOME/bin/tools
folder. If the $PATH variable does not include this folder, users may not be able to find and execute this command line tool. NCHOME is the default installation directory of NCache.
register-ncacheevaluation -key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -firstname John -lastname Smith -email john@yourdomain.com -registeras developer -company your_company_name
Register NCache with the Purchased License Key
You need to specify the registration type through the registeras
flag when registering a Docker container. The registration types can be Cache Server, Remote Client, or Developer. To do so, use the following command:
register-ncache -key xxxxxxxxx-xxxxxx-xxxxxxxx -environment Production -firstname John -lastname Smith -email john@yourdomain.com -registeras developer -company your_company_name
NCache Docker References
The Dockerfiles provided by NCache at GitHub contain commands to build images for NCache. Before you proceed any further, you need to clone this repository to your local machine, download the NCache setup, and place it under the respective Enterprise resource folder.
Moreover, NCache also provides Dockerfiles and supporting resources on GitHub to allow for more flexibility while using the NCache Docker images. You can use these Dockerfiles to make a customized image based on your dependencies to cater to specific needs.
NCache Docker Tag
For using NCache Enterprise Docker on Windows and Linux (.NET Edition), please consider the following tag:
alachisoft/ncache:latest
See Also
License Management
Licensing Model
Evaluation Period Management