Windocks Reference


Logo

Windocks is a port of the Docker daemon that runs on Windows Server 2012r2, Server 2016, Server 2019 and supports .NET, SQL Server, and Windows application containers. Windocks is available in three editions:

  • Windocks Community Edition is a free edition that includes the full features of Windocks SQL, but is limited to 5 containers with one SQL Server database per container, and non-commercial use.
  • Windocks Standard Edition supports .NET and Windows application containers.
  • Windocks SQL supports .NET and Windows application containers plus Microsoft SQL Server 2008, 2008 R2, 2012, and 2014.

Docker clients for Mac, Linux, Windows

For Windows, the Windocks client is part of the install package in the bin directory. You may download docker 1.7.0 clients for Mac, Linux and Windows from Docker at:

Docker Mac client

Docker Windows client

Docker Linux client

Using Windocks:

To start the Windocks daemon open a new command prompt as administrator and enter:

docker -H tcp://0.0.0.0:2375 -d

Server Resources: the host disk partition can be as low as 50 GB for Windocks with SQL Server 2008 or 2012, but should be 100 GB when using SQL Server 2014. A server with 8 GB of RAM can support up to 40 running instances of SQL Server 2012. SQL Server 2014 has a larger memory footprint of 550 MB, and will scale similarly with adequate RAM. Windocks Standard (no SQL Server container support) runs well on a minimal Windows Server 2012 AWS VM (1 cpu, 1 GB of RAM, and 30 GB disk). The same configuration will also support SQL Server containers but requires a minimum of 50 GB of disk.

Windocks Configuration: Windocks includes Administrative controls for the following resources set in the Windocks directory \config\node.cfg file.

  • Ports are used for container access, and the default configuration is 200 ports. Ports are freed whenever a container is removed, so regular maintenance should include the removal of un-used containers. The server VM must be configured to allow for inbound support of the Docker daemon at port 2375, and for the port range required for container ports (default Windocks configuration is for 200 ports, range from 10001 to 10200).
  • SQL Server support includes an option for exposing SA passwords in the container return string. This is enabled with “SHOW_SA_PASSWORD=”1”
  • Administrative privileged commands can be defined and implemented in Dockerfiles through the \Windocks\config\node.cfg file. Windocks ships with a sample command RUN_AS_ADMIN_CLONEDB=”copy”. This allows you to use other programs to quickly clone large MDF files. There is also another admin command in the node.cfg file RUN_AS_ADMIN_CMD=“cmd.exe”. This allows any container creator to execute any program as an administrator. See the dockerfiles in the samples directory for examples of these

Windocks supports the use of network mounts for SQL Server databases. As is the case with Volume management of Docker on Linux, mount points need to be monitored and cleaned up after containers are stopped or removed. Windocks SQL Server containers release their mount points whenever the container is stopped or removed.

Windocks Commands:

Windocks supports the following subset of Docker commands. Remote clients must use the standard Docker syntax:


docker –H=tcp://[windocks.host.ip.address]:2375 <command> <options> <args>

The docker client can also be used locally on the host, without the “-H=tcp:// . . . “ string:

docker <command> <options>> <args>



Open the Command Prompt, and start the Windocks by entering:

docker build <directory>
Must include a Dockerfile, with first line of FROM , and subsequent lines can include ADD, COPY, RUN, ADDDB, or MOUNTDB. Unlike Docker on Linux, the Build command creates a container, but does not automatically create an associated image. See the Commit command for creating a Windocks image. The advantage of this behavior is improved support for SQL Server database mounts.

docker commit <containerid> <imagename> <command>
--c (change) to include the command

docker create <option&> <image>
--cidfile=<filename>

docker exec <containerid> <command>
privileged=true is an option

docker images
Lists saved and base Images

docker ps
Lists containers on the host

docker rm <containerid1> <contanerid2>
Remove: a subset of the Container ID will work

docker rmi <imagename>
Remove Image: use full image name

docker run –d –cidfile=<filename> <containerid>
--cidfile=<filename> including –d is required to provide the client with return string of container details

docker start <containerid>
 

docker stop <containerid>
 

Windocks Use Illustrated

A Windocks client command to create and start (run) a SQL Server 2012 container is shown below. The container ID, Container Port, and the SQL password are underlined below.

SQL containers

Working with Data:

Windocks offers three methods for working with SQL Server databases:

  • Databases attached to the administrative SQL Server instance are copied into each container.
  • Databases can be copied into the container and attached to SQL Server using Dockerfiles with the ADDDB command. Note: Windocks requires the database to be located in the dockerfile path, and is referenced with a relative path. In the Dockerfile:

    ADDDB <dbname> <db.mdf> <db.ndf>

  • Databases can be mounted, using Dockerfiles with the MOUNTDB command. Note: SQL Server requires full network paths for mounting databases, or a local db on the host, using a local path.

    MOUNTDB <dbname> \\network path\ \\path\ \\path\<db.ldf>

    MOUNTDB <dbname> c:\path\

See the dockerfiles in the samples directory

Databases are attached to SQL Server when the containers are started, and detached when containers are stopped or removed (mounted databases are unmounted when containers are stopped or removed). Mounted databases, and their mount points, are not retained in committed images. Windocks supports one mount to a database. Mount points are recorded through stdout in the client return string.

SQL containers

Release Notes:

Windocks offers three methods for working with SQL Server databases:

  • To create a custom image, first create a container using >docker build, and then save using >docker commit <containerid> <imagename>
  • Docker rmi functions on full image name only and won’t operate with image id
  • Dockerfiles with ADDDB requires the database files be located in the same folder as the dockerfile.
  • Docker client - - help information should be disregarded when using Windocks.
  • Windocks clients will experience occasional errors with an immediate message: “sqlite3: columns parent_id;” Simply repeat the command.
See the dockerfiles in the samples directory

Community Support

Join the community to share tips, or solve problems at our Linkedin group

For suggestions for new features or support, contact us by email at support@windocks.com