Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: in docker container section, added flag --restart unless-stopped to restart the container if the server gets rebooted.

...

  1. Install the Docker engine.
    1. Create a file called docker.list in /etc/apt/sources.list.d with the following content:

      Code Block
      languagetext
      root@host:/etc/apt/sources.list.d# vi docker.list
      deb https://apt.dockerproject.org/repo ubuntu-xenial main
    2. Install the key.

      Code Block
      languagetext
      root@host:/etc/apt/sources.list.d# apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
      Expand
      titleClick to see the output ...
      Code Block
      languagetext
      Executing: /tmp/tmp.HNelHyq1PD/gpg.1.sh --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
      gpg: requesting key 2C52609D from hkp server p80.pool.sks-keyservers.net
      gpg: key 2C52609D: public key "Docker Release Tool (releasedocker) <docker@docker.com>" imported
      gpg: Total number processed: 1
      gpg:               imported: 1  (RSA: 1)
    3. Update the package lists.

      Code Block
      languagetext
      root@host:/etc/apt/sources.list.d# apt-get update
      Expand
      titleClick to see the output ...
      Code Block
      Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
      Hit:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease      
      Hit:3 http://security.ubuntu.com/ubuntu xenial-security InRelease       
      Hit:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease    
      Get:5 https://apt.dockerproject.org/repo ubuntu-xenial InRelease [20.6 kB]
      Fetched 20.6 kB in 0s (46.3 kB/s)                         
      Reading package lists... Done
    4. Install Docker on the Ubuntu host.

      Code Block
      languagetext
      root@host:/etc/apt/sources.list.d# apt-get install docker-engine
      Expand
      titleClick to see the output ...
      Code Block
      languagetext
      Reading package lists... Done
      Building dependency tree       
      Reading state information... Done
      The following additional packages will be installed:
      aufs-tools cgroupfs-mount git git-man liberror-perl libltdl7
      Suggested packages:
      mountall git-daemon-run | git-daemon-sysvinit git-doc git-el git-email
      git-gui gitk gitweb git-arch git-cvs git-mediawiki git-svn
      The following NEW packages will be installed:
       aufs-tools cgroupfs-mount docker-engine git git-man liberror-perl libltdl7
      0 upgraded, 7 newly installed, 0 to remove and 86 not upgraded.
      Need to get 18.4 MB of archives.
      After this operation, 99.3 MB of additional disk space will be used.
      Do you want to continue? [Y/n] Y
      Get:1 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 aufs-tools amd64 1:3.2+20130722-1.1ubuntu1 [92.9 kB]
      Get:2 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 docker-engine amd64 1.11.2-0~xenial [14.5 MB]
      Get:3 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 cgroupfs-mount all 1.2 [4,970 B]
      Get:4 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libltdl7 amd64 2.4.6-0.1 [38.3 kB]
      Get:5 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 liberror-perl all 0.17-1.2 [19.6 kB]
      Get:6 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 git-man all 1:2.7.4-0ubuntu1 [735 kB]
      Get:7 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 git amd64 1:2.7.4-0ubuntu1 [3,006 kB]
      Fetched 18.4 MB in 8s (2,076 kB/s)                                             
      Selecting previously unselected package aufs-tools.
      (Reading database ... 59668 files and directories currently installed.)
      Preparing to unpack .../aufs-tools_1%3a3.2+20130722-1.1ubuntu1_amd64.deb ...
      Unpacking aufs-tools (1:3.2+20130722-1.1ubuntu1) ...
      Selecting previously unselected package cgroupfs-mount.
      Preparing to unpack .../cgroupfs-mount_1.2_all.deb ...
      Unpacking cgroupfs-mount (1.2) ...
      Selecting previously unselected package libltdl7:amd64.
      Preparing to unpack .../libltdl7_2.4.6-0.1_amd64.deb ...
      Unpacking libltdl7:amd64 (2.4.6-0.1) ...
      Selecting previously unselected package docker-engine.
      Preparing to unpack .../docker-engine_1.11.2-0~xenial_amd64.deb ...
      Unpacking docker-engine (1.11.2-0~xenial) ...
      Selecting previously unselected package liberror-perl.
      Preparing to unpack .../liberror-perl_0.17-1.2_all.deb ...
      Unpacking liberror-perl (0.17-1.2) ...
      Selecting previously unselected package git-man.
      Preparing to unpack .../git-man_1%3a2.7.4-0ubuntu1_all.deb ...
      Unpacking git-man (1:2.7.4-0ubuntu1) ...
      Selecting previously unselected package git.
      Preparing to unpack .../git_1%3a2.7.4-0ubuntu1_amd64.deb ...
      Unpacking git (1:2.7.4-0ubuntu1) ...
      Processing triggers for libc-bin (2.23-0ubuntu3) ...
      Processing triggers for man-db (2.7.5-1) ...
      Processing triggers for ureadahead (0.100.0-19) ...
      Processing triggers for systemd (229-4ubuntu4) ...
      Setting up aufs-tools (1:3.2+20130722-1.1ubuntu1) ...
      Setting up cgroupfs-mount (1.2) ...
      Setting up libltdl7:amd64 (2.4.6-0.1) ...
      Setting up docker-engine (1.11.2-0~xenial) ...
      Setting up liberror-perl (0.17-1.2) ...
      Setting up git-man (1:2.7.4-0ubuntu1) ...
      Setting up git (1:2.7.4-0ubuntu1) ...
      Processing triggers for libc-bin (2.23-0ubuntu3) ...
      Processing triggers for ureadahead (0.100.0-19) ...
      Processing triggers for systemd (229-4ubuntu4) ...
  2. Check the Docker service on the Ubuntu 16.04 host.

    Code Block
    languagetext
    root@host:/etc/apt/sources.list.d# ps -ef | grep docker
    root      5378     1  0 19:35 ?        00:00:00 /usr/bin/docker daemon -H fd://
    root      5399  5378  0 19:35 ?        00:00:00 docker-containerd -l /var/run/docker/libcontainerd/docker-containerd.sock --runtime docker-runc --start-timeout 2m
    vagrant   5538  3579  0 19:38 pts/0    00:00:00 grep --color=auto docker
  3. Optional: Pull the Cumulus Quagga container image from Dockerhub. If you don't pull the image here, it will be done in the next step for you automatically.

    Code Block
    languagetext
    root@host:/etc/apt/sources.list.d# docker pull cumulusnetworks/quagga:latest
    Expand
    titleClick to see the output ...
    Code Block
    languagetext
    latest: Pulling from cumulusnetworks/quagga
    5ba4f30e5bea: Pull complete 
    9d7d19c9dc56: Pull complete 
    ac6ad7efd0f9: Pull complete 
    e7491a747824: Pull complete 
    a3ed95caeb02: Pull complete 
    a2e15afd186f: Pull complete 
    c79a17f1dd48: Pull complete 
    b9ce745e3bfd: Pull complete 
    871c6c942d89: Pull complete 
    0295811cd443: Pull complete 
    6aaf3dc92cbd: Pull complete 
    e6e55669dd82: Pull complete 
    e3a986b5efb0: Pull complete 
    dd11dcae39d1: Pull complete 
    2feeda2bf3a6: Pull complete 
    Digest: sha256:dcabf5df4f631719a709bf84f1536d91ebd2d0c115f97b55090c9afaefac5657
    Status: Downloaded newer image for cumulusnetworks/quagga:latest
  4. Create the container.
    1. Create the container in privileged mode, naming the container Quagga. The container ID gets returned, even if you specify a name, as you can see in the example below.

      Code Block
      languagetext
      root@host:/root# docker run -t -d --net=host --privileged --restart unless-stopped --name Quagga cumulusnetworks/quagga:latest
      cf0daeb70ceaf32d15b3fd27f80a355b3e88b178f7d7d53840c395d93e568a73
      Note

      The container must run in privileged mode to interact with the kernel routing table.

    2. Optional: To create the container using a custom Quagga.conf configuration or with daemons other than BGP enabled, run the container while mounting files as volumes, as shown below.

      Code Block
      languagetext
      root@host:/etc/apt/sources.list.d# docker run -t -d --net=host --privileged --name Quagga \
          -v /root/Quagga.conf:/etc/quagga/Quagga.conf \
          -v /root/daemons:/etc/quagga/daemons \
          cumulusnetworks/quagga:latest
      
  5. Validate the container.
    1. Check all containers on the system.

      Code Block
      languagetext
      root@host:/root# docker ps -a
      Expand
      titleClick here to see the output ...
      Code Block
      languagetext
      CONTAINER ID        IMAGE                                  COMMAND             CREATED             STATUS                      PORTS               NAMES
      cf0daeb70cea        cumulusnetworks/quagga:latest          "/bin/bash"         2 minutes ago       Up 2 minutes                                    Quagga
      Note

      Running docker ps  (without the -a option) only shows active ("up") containers on the system; the -a option shows all containers.

    2. Check the configuration on the container.

      Code Block
      languagetext
      root@host:/root# docker exec -i -t Quagga /usr/bin/vtysh
      Expand
      titleClick here to see the output ...
      Code Block
      languagetext
      root@host:/root# docker exec -i -t Quagga /usr/bin/vtysh
      Hello, this is Quagga (version 0.99.23.1+cl3u2).
      Copyright 1996-2005 Kunihiro Ishiguro, et al.
      host# show run
      Building configuration...
      Current configuration:
      !
      username cumulus nopassword
      !
      service integrated-vtysh-config
      !
      interface docker0
       ipv6 nd suppress-ra
       link-detect
      !
      interface lo
       link-detect
      !
      interface veth0c6e8a7
       link-detect
      !
      ip forwarding
      !
      line vty
      !
      end
      host#

...