Using Onedock
Last updated
Last updated
All this examples have been carried out using the oneadmin user. If you installed opennebula successfully you should be able to switch to the oneadmin account:
To create the datastore you just have to create a new datastore using the onedock type for both datastores and transfer manager. An example (as oneadmin):
Then you have to create a image in the new datastore. An example (as oneadmin):
The PATH can be set to a real image in docker hub (prepending docker:// and using the docker hub notation) or to a docker image file exported by using the command docker save
. In case that the path points to a docker resource, ONEDock will download it to the local registry to avoid that the internal nodes have to get it from the Internet. To be able to use the image you have to wait until it's in "rdy" state.
You have to create a virtual network to be used for the containers. An example (as oneadmin), that has to be customized for your network and your bridge:
In this example we assume that the we are using the docker0
bridge, and it allows packet forwarding and network access to the containers, but you can create your own bridges (e.g. br0, br1, etc.) to configure your network as usual.
This example also assumes some specific network parameters, but you should set the parameters of your network (i.e. IP address, DNS, gateway etc.).
You can list the details of the docker0
interface to find out the correct values for DNS and GATEWAY:
In the previous example, these should be set to 172.17.0.1.
Now you should add some virtualization hosts, as usual. You can use the onedock VMM:
The use of $HOSTNAME in this particular case is for using the OpenNebula front-end as one of the hosts on which to deploy containers.
Finally you can deploy one Docker container out of that image:
(where the parameter --disk ubuntu points to the just created image id).
To be able to use the container you have to wait until it's in "runn" state.
Notice that the very same OpenNebula interfaces are used but instead of deploying a VM, a Docker container is deployed.