Get Started with Zing® 11 in a Docker Container

Need a different Linux distro? Go back to the Zing Quick Start Guide

Note: Our software distributions are signed by an OpenPGP key when appropriate. To verify your download, see Product Signing Keys (OpenPGP) for details.

These instructions introduce you to the quick and easy process of installing Zing in a container on the plarform of your choice. Docker is used as an example below.

The instructions assume root privileges in the containerized environment.

To run Zing in a container, you need to:

  1. install Zing on a host
  2. run a Docker container with special flags to ensure visibility of the Zing Memory Device in a container
  3. install Zing into the container instance

Step 1: Install Zing on the Docker Host

Select the platform of your choice on the Get Started with Zing page and follow the instructions for installing Zing on the required platform.

Once Zing is installed on the Docker Host, (that is the machine where you will run the docker run command later), proceed to installing Zing in a container described below.

Step 2: Create and Run a Docker Container

Now that you have Zing installed on your host, create and run a Docker container instance:

  • on Debian-based systems:
  • docker run --name zing-container-name  -i -t --device /dev/zing_mm0:/dev/zing_mm0 ubuntu:18.04
  • on RPM-based systems:
  • docker run --name zing-container-name -i -t --device /dev/zing_mm0:/dev/zing_mm0 centos:7


    • zing-container-name stands for the name of the container you created.
    • zing_mm0 is the Zing memory device. It must be present and visible every time you run Zing (not only when you install Zing).
    • --device is required to run Zing in a container.

    Alternatively, you can write your commands in a Dockerfile. See an example of a Dockerfile for Ubuntu 16.04 LTS below:

      From ubuntu:16.04
      RUN apt-get update -y
      RUN apt-get install -y software-properties-common python-software-properties
      RUN apt-key adv --keyserver hkp:// --recv-keys 0xB1998361219BD9C9
      RUN /usr/bin/apt-add-repository "deb $(lsb_release -sc) main"
      RUN apt-get update -y
      RUN apt-get install zing-jdk11.0.0 -y
      WORKDIR /temp
      ADD ./license /etc/zing/

    Step 3: Install Zing in a Container

    When your Docker container is up and running, install the Zing package into it:

      1. Install Zing into your Docker container:
        • on Debian-based systems:
        • apt-get update
          apt-get install software-properties-common
        • on RPM-based systems:
        • curl -o /etc/yum.repos.d/zing.repo
      2. Copy Azul's public key:
        • on Debian-based systems:
        • apt-key adv --keyserver hkp:// --recv-keys 0xB1998361219BD9C9
        • on RPM-based systems:
        • rpm --import
      3. Run the commands below to complete the installation:
        • on Debian-based systems:
        • apt-add-repository "deb $(lsb_release -sc) main"
          apt-get update
          apt-get install zing-jdk11.0.0
        • on RPM-based systems:
        • yum install zing-jdk11.0.0
      4. Copy the license file to the /etc/zing folder of the container.

    To verify that the Zing Virtual Machine is successfully installed in a container, use the following command:

    /opt/zing/zing-jdk11/bin/java -version

    The output should look similar to the snippet below:

      java version "11.0.1" 2018-12-12 LTS
      Zing Runtime Environment for Java Applications (build 11.0.1+13-LTS)
      Zing 64-Bit Tiered VM (build 11.0.1-zing_18.12.0.0-b9-product-azlinuxM-X86_64, mixed mode)

    To set the JAVA_HOME environment variable to point to the Zing installation directory, use:

    $ export JAVA_HOME=/opt/zing/zing-jdk11

    To find information about post-installation steps that vary for each platform, choose the platform of your choice from the list below:

    Finally, you are ready to start running your Java applications using the Zing Virtual Machine in a container as follows:

    /opt/zing/zing-jdk11/bin/java -jar <TestApp.jar>

    If your output does not display, visit the Zing Community Forum.

    This concludes an overview of steps that are required to install and use Zing in a container.

    See Also:

    Zing System Requirements

    Zing Troubleshooting Guide

    Zing Virtual Machine Release Notes

    Zing User’s Guide

    Zing Community Forum