Progress to Acquire MarkLogic - Learn More
BLOG ARTICLE

MarkLogic Docker Container on Windows

Back to blog
04.02.2017
3 minute read
Back to blog
04.02.2017
3 minute read

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.

MarkLogic officially supports Docker containers with version 9.0-5 or later. Please use discretion when working with these examples using older versions of MarkLogic.
The content in this blog can be used to build a MarkLogic Windows container for development. MarkLogic officially supports running in Linux containers only. See here for details.

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:
https://blog.docker.com/2016/09/build-your-first-docker-windows-server-container/

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

Testing MarkLogic

After the container is started , simply point your browser to http://<container-ip>:8001 to initialize and enjoy all MarkLogic features!

Additional Resources

Arthi Ramachandran

Read more by this author

Share this article

Read More

Related Posts

Like what you just read, here are a few more articles for you to check out or you can visit our blog overview page to see more.

Tutorial

Poker Fun with XQuery

In this post, we dive into building a full five-card draw poker game with a configurable number of players. Written in XQuery 1.0, along with MarkLogic extensions to the language, this game provides examples of some great programming capabilities, including usage of maps, recursions, random numbers, and side effects. Hopefully, we will show those new to XQuery a look at the language that they may not get to see in other tutorials or examples.

All Blog Articles
Tutorial

Protecting passwords in ml-gradle projects

If you are getting involved in a project using ml-gradle, this tip should come in handy if you are not allowed to put passwords (especially the admin password!) in plain text. Without this restriction, you may have multiple passwords in your gradle.properties file if there are multiple MarkLogic users that you need to configure. Instead of storing these passwords in gradle.properties, you can retrieve them from a location where they’re encrypted using a Gradle credentials plugin.

All Blog Articles
Tutorial

Getting Started with Apache Nifi: Migrating from Relational to MarkLogic

Apache NiFi introduces a code-free approach of migrating content directly from a relational database system into MarkLogic. Here we walk you through getting started with migrating data from a relational database into MarkLogic

All Blog Articles

Sign up for a Demo

Don’t waste time stitching together components. MarkLogic combines the power of a multi-model database, search, and semantic AI technology in a single platform with mastering, metadata management, government-grade security and more.

Request a Demo