Whilst writing a new set of articles around Citrix ADC (NetScaler) I noticed that you could deploy it onto a Docker instance. This sounded interesting as I had never really played around with Docker so its good to merge the two technologies and so this post was born.
So what is the NetScaler CPX? It is basically a container version of a NetScaler with the basic load balancing features. Running NetScaler in a container gives us much more deployment options and has a much lower footprint than a normal NetScaler. It enables us to integrate NetScaler into microapp architectures that we can deploy via Kubernetes. That is just one example but the possibilities are endless.
So let’s get cracking. The requirements listed in https://docs.citrix.com/en-us/citrix-adc-cpx/12/deploy-using-docker-image-file.html are:
- Docker Host system is running Linux Ubuntu 14.04 (I chose 18.04)
- Docker version 1.12 is installed on the Host System
- Docker Host System has at least 1 CPU and 2GB RAM
- Docker Host has internet connectivity
After installing Docker open a terminal window and execute the command
“Sudo docker pull store/citrix/netscalercpx:12.0-56.20” This will pull down the latest version of NetScaler CPX from the Docker repository.
If we type sudo docker images this gives us a list of Docker images that we have pulled down. As we can see the NetScaler CPX image is present.
So now that we have the Docker image downloaded we need to run it. To do that execute the following:
“sudo docker run –e EULA=yes –dt –P –ulimit core=-1 –cap -add=NET_ADMIN store/citrix/netscalercpx:12.0-56.20
After this run’s it generates a long ID. Not quite sure what this is?! Now if we run “sudo docker ps” we can see that the container is up and running
If we run sudo docker inspect and the container ID it gives us more information about the config and most importantly the IP address.
If we then connect to that IP it works successfully. I was expecting a NetScaler config GUI but it seems this version does not have that. So you have to configure everything from the command line
To connect to the command line execute the following command:
ssh root@172.17.0.2 (obviously that will change in your environment) . The default password is linux
Once logged in you can configure via the normal commands you would normally use
I hope this post has been interesting and helpful to you. I have certainly learnt from it.
I found the following resources very useful whilst writing this so if you get any issues then they are worth a look
https://linuxize.com/post/how-to-install-and-use-docker-on-ubuntu-18-04/
https://docs.citrix.com/en-us/citrix-adc-cpx/12/deploy-using-docker-image-file.html
https://hub.docker.com/_/netscaler-cpx-express-rel-120-experimental
https://www.citrix.com/blogs/2017/04/27/getting-to-know-citrix-netscaler-cpx/
Hello, thank you for this nice and usefull article.
I made it, but I have a question, do you have a web page for the management of the netscaler in docker ?
I know that the goal is to manage is thru command line, but sometime, when you are not an expert, it’s usefull to have an interface to manage certificates, content swith, load balancer etc… What you get when you download the VM.
thanks you
Patrick
sorry, I just read in your article : “If we then connect to that IP it works successfully. I was expecting a NetScaler config GUI but it seems this version does not have that. So you have to configure everything from the command line”
Thank you and have a good day 😉
root@CTX:~# docker version
Client:
Version: 18.09.5
API version: 1.39
Go version: go1.10.4
Git commit: e8ff056
Built: Fri Apr 12 00:34:27 2019
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.09.5
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: e8ff056
Built: Fri Apr 12 00:27:37 2019
OS/Arch: linux/amd64
Experimental: false
root@CTX:~#
root@CTX:~# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
store/citrix/netscalercpx 12.0-56.20 8528cafdfa33 23 months ago 375MB
root@CTX:~#
root@CTX:~# docker run –e EULA=yes –dt –P –ulimit core=-1 –cap -add=NET_ADMIN store/citrix/netscalercpx:12.0-56.20
docker: invalid reference format.
See ‘docker run –help’.
root@CTX:~#
root@CTX:~# docker run -e EULA=yes store/citrix/netscalercpx:12.0-56.20
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused “process_linux.go:430: container init caused \”rootfs_linux.go:58: mounting \\\”proc\\\” to rootfs \\\”/var/lib/docker/vfs/dir/40958959a650ddff0dbd03dc445defbfb13db29d5760d9f669e075f4d2fe7981\\\” at \\\”/proc\\\” caused \\\”permission denied\\\”\””: unknown.
ERRO[0011] error waiting for container: context canceled