Book Image

Containers in OpenStack

Book Image

Containers in OpenStack

Overview of this book

Containers are one of the most talked about technologies of recent times. They have become increasingly popular as they are changing the way we develop, deploy, and run software applications. OpenStack gets tremendous traction as it is used by many organizations across the globe and as containers gain in popularity and become complex, it’s necessary for OpenStack to provide various infrastructure resources for containers, such as compute, network, and storage. Containers in OpenStack answers the question, how can OpenStack keep ahead of the increasing challenges of container technology? You will start by getting familiar with container and OpenStack basics, so that you understand how the container ecosystem and OpenStack work together. To understand networking, managing application services and deployment tools, the book has dedicated chapters for different OpenStack projects: Magnum, Zun, Kuryr, Murano, and Kolla. Towards the end, you will be introduced to some best practices to secure your containers and COE on OpenStack, with an overview of using each OpenStack projects for different use cases.
Table of Contents (17 chapters)
Title Page
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface

Installation of Docker


Docker is available in two editions, Community Edition (CE) and Enterprise Edition (EE):

  • Docker Community Edition (CE): It is ideal for developers and small teams looking to get started with Docker and may be experimenting with container-based apps
  • Docker Enterprise Edition (EE): It is designed for enterprise development and IT teams who build, ship, and run business critical applications in production at scale

This section will demonstrate the instructions for installing Docker CE on Ubuntu 16.04. The Docker installation package, available in the official Ubuntu 16.04 repository, may not be the latest version. To get the latest and greatest version, install Docker from the official Docker repository. This section shows you how to do just that:

  1. First, add the GPG key for the official Docker repository to the system:
        $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg |
        sudo apt-key add 
  1. Add the Docker repository to APT sources:
        $ sudo add-apt-repository "deb [arch=amd64]
        https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 
  1. Next, update the package database with the Docker packages from the newly added repository:
        $ sudo apt-get update 
  1. Make sure you are about to install Docker repository instead of the default Ubuntu 16.04 repository:
        $ apt-cache policy docker-ce 
  1. You should see an output similar to the following:
        docker-ce:
          Installed: (none)
          Candidate: 17.06.0~ce-0~ubuntu
          Version table:
             17.06.0~ce-0~ubuntu 500
                500 https://download.docker.com/linux/ubuntu xenial/stable 
                amd64 Packages
             17.03.2~ce-0~ubuntu-xenial 500
                500 https://download.docker.com/linux/ubuntu xenial/stable 
                amd64 Packages
             17.03.1~ce-0~ubuntu-xenial 500
               500 https://download.docker.com/linux/ubuntu xenial/stable 
               amd64 Packages
             17.03.0~ce-0~ubuntu-xenial 500
              500 https://download.docker.com/linux/ubuntu xenial/stable 
              amd64 Packages

Note

Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Ubuntu 16.04. The docker-ce version number might be different.

  1. Finally, install Docker:
        $ sudo apt-get install -y docker-ce 
  1. Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it's running:
        $ sudo systemctl status docker
        docker.service - Docker Application Container Engine
           Loaded: loaded (/lib/systemd/system/docker.service; enabled; 
        vendor preset: enabled)
           Active: active (running) since Sun 2017-08-13 07:29:14 UTC; 45s
        ago
             Docs: https://docs.docker.com
         Main PID: 13080 (dockerd)
           CGroup: /system.slice/docker.service
                   ├─13080 /usr/bin/dockerd -H fd://
                   └─13085 docker-containerd -l 
           unix:///var/run/docker/libcontainerd/docker-containerd.sock --
           metrics-interval=0 --start
  1. Verify that Docker CE is installed correctly by running the hello-world image:
        $ sudo docker run hello-world 
        Unable to find image 'hello-world:latest' locally 
        latest: Pulling from library/hello-world 
        b04784fba78d: Pull complete 
        Digest:
        sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26
        ff74f 
        Status: Downloaded newer image for hello-world:latest 
 
        Hello from Docker!
        This message shows that your installation appears to be
        working correctly.
        To generate this message, Docker took the following steps:
        The Docker client contacted the Docker daemon
        The Docker daemon pulled the hello-world image from the Docker Hub
        The Docker daemon created a new container from that image, 
        which ran the executable that produced the output you are 
        currently reading 
        The Docker daemon streamed that output to the Docker client, 
        which sent it to your terminal
        To try something more ambitious, you can run an Ubuntu 
        container with the following:
         $ docker run -it ubuntu bash 
        Share images, automate workflows, and more with a free Docker ID: 
        https://cloud.docker.com/ 
        For more examples and ideas,
        visit: https://docs.docker.com/engine/userguide/.