Installing NetScaler CPX on a Docker Host Using the Dockerfile

Important

The Dockerfile for NetScaler CPX is deprecated. If you used Dockerfile, the replacement is NetScaler CPX from the Docker Store. For information about how to download NetScaler CPX from the Docker Store and to deploy NetScaler CPX in Docker, see Deploying a NetScaler CPX Instance in Docker.

NetScaler CPX is also available as a Dockerfile. You need to build the NetScaler CPX image file from the Dockerfile and then deploy the NetScaler CPX instance using the Linux shell or Docker compose tool.

Prerequisites

Make sure that you have the following:

  • 1 CPU
  • 2 GB RAM
  • Linux Ubuntu version 14.04 and later.
  • The system is updated by using the apt-get command.
  • The following packages are installed: libc6-dev:i386, gcc-multilib, g++-multilib, lib32ncurses5-dev, zlib1g-dev:i386, libssl-dev:i386, build-essential
  • Docker is installed on the Linux host system. To install Docker, run the following command at the Linux shell prompt:
     curl –ssl <https://get.docker.com/> | sh
    

    For more information about Docker installation on Linux, see https://docs.docker.com/engine/installation/ubuntulinux/

  • Docker host has Internet connectivity.
  • You are logged on as the root user.
  • Obtain the NetScaler CPX Dockerfile from your Citrix representative and copy it to your Linux Ubuntu system.

To build the NetScaler CPX Image using the Dockerfile:

1. Extract the contents of the NetScaler CPX Dockerfile. To do so, navigate to the directory where you saved the image file and then run the following command:

tar –xvzf <image_file_name>
root@ubuntu:~# cd /var/cpx-build
root@ubuntu:/var/cpx-build# ls
cpx.tar.gz
root@ubuntu:/var/cpx-build# tar –xvzf cpx.tar.gz

2.  Create a NetScaler CPX Docker image. Navigate to the directory where the image file is extracted and then run the following command:

make
root@ubuntu:/var/cpx-build# cd cpx
root@ubuntu:/var/cpx-build/cpx# ls
Dockerfile  Makefile  netscaler.tar.gz
root@ubuntu:/var/cpx-build/cpx# make

3. After the NetScaler CPX Docker image is created, you can view the details of the image by running the following command:

docker images

For example:

root@ubuntu:~# docker images
REPOSITORY  TAG         IMAGE ID     CREATED    VIRTUAL SIZE
cpx      11.1-48.10   2e97aadf918b  43 hours ago   605.5 MB

In this example, note the following fields in the output:

  • REPOSITORY. Specifies the name space where the image is stored.
  • TAG. Denotes the version of the NetScaler CPX image that is installed.
  • IMAGE ID. Denotes the unique ID of the image in the Docker host.

Deploying the NetScaler CPX Instance

After you have obtained the NetScaler CPX image you can deploy the NetScaler CPX instance using the Linux shell or Docker compose tool.

Deploying the NetScaler CPX Instance Using the Linux Shell

Using the Linux shell, navigate to the directory where you saved the NetScaler CPX image and then deploy the NetScaler CPX instance by using the docker run command, to enable external communication, you have to open the following ports: HTTP port 80, SSH port 22, and SNMP port 161.

docker run -dt -p <port number> --ulimit core=-1 --privileged=true –e <REPOSITORY>:<TAG>
docker run -dt -p 22 -p 80 -p 161/udp --ulimit core=-1 --privileged=true -e EULA=yes cpx:11.1-48.10

You can view the images running on your system and the ports mapped to the standard ports by using the command: docker ps

CONTAINER ID    IMAGE         COMMAND       CREATED     STATUS     PORTS     NAMES

6fe01203e7b9  cpx:11.1-48.10  "/bin/sh -c 'bash -C "   7 seconds ago       Up 5 seconds        443/tcp, 0.0.0.0:32769->22/tcp, 0.0.0.0:32768->80/tcp, 0.0.0.0:32768->161/udp   lonely_knuth

Deploying NetScaler CPX Instances by Using Docker Compose

You can use the Compose tool of Docker to provision a single NetScaler CPX instance or multiple NetScaler CPX instances. To provision NetScaler CPX instances by using Compose, you must first write a compose file specifying the NetScaler CPX image, ports that you want to open for the NetScaler CPX instance, and the privileges for your NetScaler CPX instance.

To provision multiple NetScaler CPX instances:

1.  Write a compose file. The compose file generally follows a format similar to:

<service-name>:

      image: <repository>:<tag>

      ports:

     - 22

     - 80

     - 161/udp

     - 36001-36010

      tty: true

      privileged: true

Where:

  • <service-name> is the name of the service you want to provision.
  • image:<repository>:<tag> denotes the repository and the versions of the NetScaler CPX image.
  • privileged: true provides all root privileges to the NetScaler CPX instance.
cpxlb:
    image: cpx:11.1-48.10
    ports:
       - 22
       - 80
       - 161/udp
       - 36001-36010
   tty: true
   privileged: true

Note

If you want to provision a single NetScaler CPX instance, you must add the following line to the compose file:

container_name:<name_of_container>

2.  Run the following command to provision multiple NetScaler CPX instances:  

docker-compose -f <compose_file_name> scale <service-name>=<number of instances> up –d
docker-compose -f docker-compose.yml scale cpxlb=3 up –d

Note

If you want to provision a single NetScaler CPX instance, run the following command:

docker-compose -f <compose_file_name> up –d

Installing NetScaler CPX on a Docker Host Using the Dockerfile