Docker Cookbook


CHAPTER 1 Getting Started with Docker



Download 6,31 Mb.
Pdf ko'rish
bet13/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   9   10   11   12   13   14   15   16   ...   260
Bog'liq
Docker Cookbook

CHAPTER 1
Getting Started with Docker
1.0 Introduction
Getting started with Docker is straightforward. The core of Docker is made of the
Docker engine, a single-host software daemon that allows you to create and manage
containers. Before diving into using Docker, you need to install the Docker engine on
a host, either your desktop, laptop, or a server.
The first recipes in this chapter go through the installation steps to get Docker run‐
ning in your server. The official Docker documentation covers almost all cases of
operating systems. Here we cover Ubuntu 14.04 (
Recipe 1.1
), CentOS 6.5 (
Recipe 1.2
)
and CentOS 7 (
Recipe 1.3
). If you want to use Vagrant, 
Recipe 1.4
 is for you.
We also show how to install Docker on Raspberry Pi (
Recipe 1.5
) to present an instal‐
lation for ARM processors. For Windows and OS X hosts you can use the Docker
toolbox, which packages several Docker utilities in addition to the Docker engine (see
Recipe 1.6
). The Docker toolbox uses a virtual machine running via VirtualBox to act
as a Docker host. This machine is called boot2docker. While using boot2docker is
now deprecated in favor of the Docker toolbox, we still present a Docker installation
using boot2docker in 
Recipe 1.7
.
To round up the installation recipes, we introduce 
docker-machine
, a Docker utility
that lets you starts a machine in the public cloud of your choice and automatically
configures it to be used with your local Docker client. 
Recipe 1.9
shows you how to
do it with the Digital Ocean cloud.
Once you have installed Docker on your favorite target, you are ready to explore the
basic commands necessary to create and manage containers. 
Recipe 1.11
 shows you
the first steps to run a container, while 
Recipe 1.13
walks you through the standard
life cycle of a container, creating, starting, stopping, killing, and removing containers.
1


With those first concepts covered, we dive straight into introducing the 
Dockerfile
(
Recipe 1.14
). A 
Dockerfile
is a manifest that describes how to build a container
image. This is a core concept in Docker and while 
Chapter 2
will expand much fur‐
ther on the topic, we cover it here in its most simple form. This allows us to introduce
a much more complex example right away, running WordPress.
First we do it in a single container by building a Docker image from scratch and run‐
ning multiple processes in the container (
Recipe 1.15
). Docker makes you change
your application designer mindset from packaging everything together to creating
multiple independent services that can then be interconnected. However, it does not
mean that you cannot run multiple services in a single container. Using 
supervisord
you can, and 
Recipe 1.15
 shows you how. But the strength of Docker comes with the
ease of composing services to run your application. Therefore in 
Recipe 1.16
we show
you how to split the single container example into two containers using container
linking. This is your first example of a distributed application, even though it runs on
a single host.
The last concept that we introduce in this chapter is data management. Making data
accessible in a container is a critical component. You might use it to load configura‐
tion variables or datasets, or to share data between containers. We use the WordPress
example again and show you how to back up your database (
Recipe 1.17
), how to
mount data in your host into your containers (
Recipe 1.18
), and also how to create
so-called data-containers (
Recipe 1.19
).
In summary, in this chapter you will go from installing the Docker engine on a host
to running a two-container WordPress site in a flash.

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   9   10   11   12   13   14   15   16   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish