MarkLogic Docker Container on Windows
In the blog Building a MarkLogic Docker Container, we created a Docker container and installed MarkLogic. Windows remains as one of the heavily-used operating systems for hosting MarkLogic Server. Please check the MarkLogic Install Guide for the most current messaging around operating systems for hosting Marklogic Server. We have greatly reduced the ramp up time for using a MarkLogic Docker container on Windows. We will see the how-tos in this blog post.
Obtain a Windows Server 2016 environment
While Docker container support on Windows exists, the user experience has been greatly simplified with the release of native container support in Windows Server 2016. Windows 10 Pro for education or enterprise is another host operating system option for Docker on Windows. On Windows 10 Pro, the user had to install and configure Docker For Windows. Windows Server 2016 with native container support was released in September, 2016. We have successfully finished the implementation of bringing that simplified Docker environment on Windows to you. As the saying goes — there is always room for continuous improvements! We are certainly interested in your feedback to further improve the offering. The following blog post will be useful for anyone interested to know more about the native container support in Windows Server 2016:
Once Docker is installed, check the Docker version and Docker help to confirm that it is installed properly.
Building a MarkLogic Docker image
The Dockerfile for building ML Docker image is below.
#download the Windows Server 2016 image from docker FROM microsoft/windowsservercore #set the working dir WORKDIR C:/ #copy MarkLogic msi file COPY MarkLogic-9.0-20161212-amd64.msi . #install MarkLogic Run msiexec.exe /qn /i MarkLogic-9.0-20161212-amd64.msi #Install cygwin SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';", "$ProgressPreference = 'SilentlyContinue';"] RUN Invoke-Webrequest https://cygwin.com/setup-x86.exe -OutFile setup.exe -UseBasicParsing RUN Start-Process -Wait -FilePath setup.exe -ArgumentList '-q', '-D', '-g', '-o', '-A', '-N', '-d', '-L', '-l "c:/cygwin-data"', '-R "c:/cygwin"', '--site "http://mirrors.kernel.org/sourceware/cygwin/"', '-P vim' ; cat .cygwinvarlogsetup.log.full EXPOSE 7997 7998 7999 8000 8001 8002 8040 8041 8042
To build the image, you will need to have the .msi file for MarkLogic in same directory that has the Dockerfile. You can download the MarkLogic 8 Windows installer from http://developer.marklogic.com/products.
cd .to.path.that.has.Dockerfile. docker build ml8-windows . where ml8-windows is the name of the docker image that is built
The following shows the expected result of the above docker build command:
docker build --no-cache -t ml8-windows .
Once the building of the Docker image is completed, you can issue
docker images command to check whether the image was created:
If your organization manages a private registry, the image can then be pushed to it using the
docker push command:
docker push <image-name>
Uploading Docker image to registry
As of January 2017, Docker Trusted Registry (private cloud) that is offered by Docker does not support hosting Windows images. Many users have raised this request to Docker support and they have plans to patch DTR to host Windows images. Shipyard is Docker management open source software that gives us the ability to manage Docker resources including containers, images and private registries. Since MarkLogic is a licensed product, it is highly important that we host MarkLogic Docker images on a private cloud to secure access. Here at MarkLogic, we have installed and configured a private Windows registry using Shipyard. Attached is an image that shows a private registry using Shipyard:
Starting a MarkLogic Docker container
First ensure that the
docker images command will list the Docker image from which you want to create a container. If you don’t have the image pulled locally from a registry, issue the
docker pull command.
docker pull <image-name>
Once you have pulled a Docker image from the private registry, you can create a MarkLogic container on Windows as follows:
docker run -d -p <portnumber> --name <container_name> <image_name> cmd
After the container is started , simply point your browser to
http://<container-ip>:8001 to initialize and enjoy all MarkLogic features!
- Read this blog on Building a MarkLogic Docker Container
- Read this blog on Automating MarkLogic Docker Installs
- Read this blog on Creating an MLCP Docker container with pre-loaded data
- Read this blog on Deploying a Marklogic Cluster using Kubernetes and NGINX
- View this webinar on Running Marklogic in Containers (Docker and Kubernetes)