diff options
Diffstat (limited to 'docs/usecases/containerCreation.rst')
-rw-r--r-- | docs/usecases/containerCreation.rst | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/docs/usecases/containerCreation.rst b/docs/usecases/containerCreation.rst index fb38b3ed135..9b2cc126133 100644 --- a/docs/usecases/containerCreation.rst +++ b/docs/usecases/containerCreation.rst @@ -5,15 +5,17 @@ Creating Containers ___________________ -First you should have root privileges: +Make sure you have gone through :ref:`installingVPP` on the system you want to create containers on. -.. code-block:: shell +After VPP is installed, get root privileges with: - ~$ sudo bash +.. code-block:: console + + $ sudo bash Then install packages for containers such as lxc: -.. code-block:: shell +.. code-block:: console # apt-get install bridge-utils lxc @@ -26,7 +28,7 @@ Since we want to ping between two containers, we'll need to **add to this file** Look at the contents of *default.conf*, which should initially look like this: -.. code-block:: shell +.. code-block:: console # cat /etc/lxc/default.conf lxc.network.type = veth @@ -40,13 +42,13 @@ Now you will *append to this file* so that each container you create will have a You can do this by piping *echo* output into *tee*, where each line is separated with a newline character *\\n* as shown below. Alternatively, you can manually add to this file with a text editor such as **vi**, but make sure you have root privileges. -.. code-block:: shell +.. code-block:: console # echo -e "lxc.network.name = veth0\nlxc.network.type = veth\nlxc.network.name = veth_link1" | sudo tee -a /etc/lxc/default.conf Inspect the contents again to verify the file was indeed modified: -.. code-block:: shell +.. code-block:: console # cat /etc/lxc/default.conf lxc.network.type = veth @@ -62,7 +64,7 @@ After this, we're ready to create the containers. Creates an Ubuntu Xenial container named "cone". -.. code-block:: shell +.. code-block:: console # lxc-create -t download -n cone -- --dist ubuntu --release xenial --arch amd64 --keyserver hkp://p80.pool.sks-keyservers.net:80 @@ -79,7 +81,7 @@ If successful, you'll get an output similar to this: Make another container "ctwo". -.. code-block:: shell +.. code-block:: console # lxc-create -t download -n ctwo -- --dist ubuntu --release xenial --arch amd64 --keyserver hkp://p80.pool.sks-keyservers.net:80 @@ -87,7 +89,7 @@ Make another container "ctwo". List your containers to verify they exist: -.. code-block:: shell +.. code-block:: console # lxc-ls cone ctwo @@ -95,13 +97,13 @@ List your containers to verify they exist: Start the first container: -.. code-block:: shell +.. code-block:: console # lxc-start --name cone And verify its running: -.. code-block:: shell +.. code-block:: console # lxc-ls --fancy NAME STATE AUTOSTART GROUPS IPV4 IPV6 @@ -114,10 +116,10 @@ And verify its running: Here are some `lxc container commands <https://help.ubuntu.com/lts/serverguide/lxc.html.en-GB#lxc-basic-usage>`_ you may find useful: - .. code-block:: shell + .. code-block:: console - sudo lxc-ls --fancy - sudo lxc-start --name u1 --daemon - sudo lxc-info --name u1 - sudo lxc-stop --name u1 - sudo lxc-destroy --name u1 + $ sudo lxc-ls --fancy + $ sudo lxc-start --name u1 --daemon + $ sudo lxc-info --name u1 + $ sudo lxc-stop --name u1 + $ sudo lxc-destroy --name u1 |