Saturday, 28 May 2016

QNAP Container Station

Docker in QNAP Container Station

A very light weight virtual environment for sandbox.

Docker networks:

-Bridge
-Host
-None
-Qnet (*Available on QNAP CS only)

The first three networks are built into Docker. When you run a container, you can use the --network flag to specify which networks your container should connect to.

Containers connected to the default bridge network can communicate with each other by IP address.

The host network adds a container on the host’s network stack. There is no isolation between the host machine and the container. If you run a container that runs a web server on port 80 using host networking, the web server is available on port 80 of the host machine.

The none and host networks are not configurable in Docker. You can configure the default bridge network, as well as your own user-defined bridge networks.

QNAP Qnet Docker Command

With QNAP CS, you can also use Docker command to create a network that belongs to Qnet driver and run a container with --net argument.
I will say the above in English :
It means you can bridge docker network to host network!!
Both docker and host can reside on the same LAN segment, and looks like 2 machine. 

DHCP mode

Create a new network named qnet-dhcp-eth1.

    $ docker network create -d qnet --ipam-driver=qnet --ipam-opt=iface=eth1 qnet-dhcp-eth1

Static mode

Create a new network named qnet-static-eth1.

    $ docker network create -d qnet --ipam-driver=qnet --ipam-opt=iface=eth1 \
          --subnet=192.168.18.0/23 --gateway=192.168.18.254 qnet-static-eth1

Reference:

https://docs.docker.com/engine/userguide/networking/
https://qnap-dev.github.io/container-station-api/qnet.html
https://success.docker.com/KBase/Multiple_Docker_Networks