Running a Container

To run a Container:

  1. Run the image and create a new container using a run command as shown below:
    # docker run --net=host --volume ~/rxlogs:/zixi_receiver-linux64/logs --volume ~/rxfiles:/zixi_receiver-linux64/files --name Receiver_13.1.38648 --publish 4300:4300/TCP zixi_receiver:13.1.38648
    The run command has many options. Below is a description of the options used in this example:

    • --net – This option allows you to choose the type of networking used in the container.

      • With “host” mode all containers on the host share the hosts networking configuration and to access a container you would use the host’s IP address, such as 192.168.10.20:4300 for the Receiver UI. If you have multiple Receiver containers running on the same host you would need to configure the Receiver in each container to use a different port for the UI and different ports for Zixi or other input and output protocols. Also, you will need to configure the firewall on the host to protect the running containers from external threats.

      • With “bridged” mode, which is the default if you do not specify the --net option, each container will have its own network that exists on host. The host will be able to directly communicate with the containers but any other device on the network cannot communicate with the containers unless IP forwarding is enabled. See this link for more information on IP forwarding on the host. Networking in bridged mode will be slightly less efficient than host mode because there is an additional layer of networking software.

    • --volume – This option allows you to mount directories inside the container to directories on your host system. In this example we are mounting the logs directory and the files directory from the Receiver installation directory to local folders which makes it easy to inspect logs or retrieve recordings from the Receiver running in the container.

    • --name – This option gives the container a human readable name when looking at the Docker process table.

    • --publish – This option is only valid with Bridged mode networking. In the dockerfile you will see that we exposed typical ports that you would use with the Receiver. However, those ports will only be opened up to the host if you also publish them in the run command. For host mode networking, all network settings are controlled on the host itself and --publish is ignored.

    • Image ID – The last option is the image ID which you see in the images table above.
      Upon using the Docker run command, there will now be a running Docker container.

  2. You can see the list of all running containers using the following command:
    # docker ps
    The output will be similar to the following (with different IDs):

CONTAINER

IMAGE

COMMAND

CREATED

STATUS

PORTS

NAMES

CONTAINER

IMAGE

COMMAND

CREATED

STATUS

PORTS

NAMES

f8f30e025166

855f142a53a7

"./zixi_receiver-…"

21 minutes ago

Up 21 minutes

 

Receiver_13.1.38648

In host mode the ports will be empty. In bridged mode the actual ports that were published will be shown. In the shell window where you issued the docker run command you will see any content going to STDOUT and STDERR inside the container on STDOUT of the docker run process on the host.

3. With the container running, you can log into the Receiver web UI at port 4300. In host mode you will use the IP address of the host itself. In bridged mode you can use a command like the following to see the IP address of the running container:

# docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq)