Previous page

Next page

Locate page in Contents

Print this page

Creating and Configuring Docker-enabled Containers

To create a Virtuozzo Container ready for running Docker containers, do the following:

  1. Create a Container with a guest OS for which a Docker application template is available. For example:

    # vzctl create 101 --ostemplate centos-7-x86_64

    In the current version of Virtuozzo, Docker application templates are available for these guest operating systems:

    • CentOS 7
    • Fedora 21
  2. Configure network access in the Container. For details, see Configuring Network Settings.
  3. Enable bridges in the Container. For example:

    # vzctl set 101 --features bridge:on --save

  4. Allow all iptables modules for the Container. For example:

    # vzctl set 101 --netfilter full --save

  5. Enable tun device in the Container. For example:

    # vzctl set 101 --devnodes net/tun:rw --save

  6. Start the Container. For example:

    # vzctl start 101

  7. Install the Docker application template into the Container. For example:

    # vzpkg install 101 docker

To check that Docker is configured correctly, you can create a test Docker container inside the configured Virtuozzo Container. For example:

  1. Increase Container RAM and diskspace for running multiple Docker containers. For example:

    # vzctl set 101 --ram 4G --save

    # vzctl set 101 --diskspace 25G:25G --save

  2. Launch MySQL:

    # docker run --name test-mysql -e MYSQL_ROOT_PASSWORD=123qwe -d mysql

  3. Launch WordPress:

    # docker run --name test-wordpress --link test-mysql:mysql -p 8080:80 -d wordpress

  4. Log in to your WordPress installation by visiting the IP address of the Virtuozzo Container at port 8080.

Note: For more information about Docker, visit http://docs.docker.com/.

Restrictions and Limitations

  • Checkpointing and live migration of Virtuozzo Containers with Docker containers inside is not supported.
  • During vzreboot operation, Virtuozzo Containers with Docker containers inside are restarted instead of being suspended and resumed.
  • Only the vfs Docker graph driver is currently supported.
  • Bridges cannot be created inside Docker containers running inside a Virtuozzo Container. (You can create bridges inside Virtuozzo Containers as usual.)