Orchestrating Docker

Orchestrating Docker

Shrikrishna Holla

Language: English

Pages: 154

ISBN: 1783984783

Format: PDF / Kindle (mobi) / ePub


About This Book
- Set up your own Heroku-like PaaS by getting accustomed to the Docker ecosystem
- Run your applications on development machines, private servers, or the cloud, with minimal cost of a virtual machine
- A comprehensive guide to the smooth management and development of Docker containers and its services

Who This Book Is For
If you are a competent developer or DevOps with a good understanding of Linux filesystems but want to manage and orchestrate Docker services, images, and products using a multitude of techniques, then this book is for you. No prior knowledge of Docker or container virtualization is required.

What You Will Learn
- Get familiar with the processes related to the automation of Docker
- Get to grips with various Docker commands and techniques that help you manage containers
- Create your own Docker image and package your web application in the image
- Use Dockerfile DSL to make your Docker images repeatable
- Deploy a high availability service on a cluster using CoreOS and fleet
- Build your application in sandboxed Docker containers

In Detail
Docker is growing in popularity by day because of its great utility, the fact that it's user friendly, and the vibrant community.

This book will help you transform the way you build, test, and deploy your applications with Docker, making it easier and enjoyable. The book starts off with the installation of Docker before gradually taking you through the different commands to start working with Docker containers and their services. You will learn to build your own Docker containers along with instructions to fine-tune the resource allocations to those containers. You will then learn to manage a cluster of Docker containers. The book demonstrates the processes related to the automation and orchestration of Docker. It then covers the compatibility of Docker with other technologies such as Puppet and Chef. Finally, it prepares you to ship your applications without taking strain for deployment. By the end of the book, you will be able to orchestrate and manage the creation and deployment of Docker containers.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

is used to try five times before giving up: $ docker run --restart=on-failure:5 code.it The search command The search command allows us to search for Docker images in the public registry. Let's search for all images related to Python: $ docker search python | less [ 33 ] Docker CLI and Dockerfile The pull command The pull command is used to pull images or repositories from a registry. By default, it pulls them from the public Docker registry, but if you are running your own registry, you

executable. The ENTRYPOINT instruction has two forms: 1. The ENTRYPOINT ["executable", "arg1", "arg2"...] form. 2. The ENTRYPOINT command arg1 arg2 … form. [ 57 ] Docker CLI and Dockerfile This instruction adds an entry command that will not be overridden when arguments are passed to the docker run command, unlike the behavior of the CMD instruction. This allows arguments to be passed to the ENTRYPOINT instruction. The docker run -arg command will pass the -arg argument to the

database container changes, only the ambassador container in the host1 phase needs to be restarted. Use case - a multi-host Redis environment Let's set up a multi-host Redis environment using the progrium/ambassadord command. There are other images that can be used as ambassador containers as well. They can be searched for either using the docker search command or at https://registry.hub.docker.com. Redis is an open source, networked, in-memory, key-value data store with optional durability. It

Here is how we would write the YAML file for Compose: containers: web: build: . command: python app.py ports: - "5000:5000" volumes: - .:/code links: - redis environment: - PYTHONUNBUFFERED=1 redis: image: redis:latest command: redis-server --appendonly yes In the preceding example, we defined two applications. One is a Python application that needs to be built from the Dockerfile in the current directory. It has a port (5000) exposed and has either a volume or a piece of code bind mounted to

. . . . . . . . . . . . . [ 125 ] Friends of Docker After the machines are created, you can SSH into them to try out the following commands, but you will need to add ssh keys to your SSH agent. Doing so will allow you to forward your SSH session to other nodes in the cluster. To add the keys, run the following command: $ ssh-add ~/.vagrant.d/insecure_private_key Identity added: /Users/CoreOS/.vagrant.d/insecure_private_key (/Users/ CoreOS/.vagrant.d/insecure_private_key) $ vagrant ssh core-01

Download sample

Download