Docker Cookbook


| Chapter 7: The Docker Ecosystem: Tools



Download 6,31 Mb.
Pdf ko'rish
bet177/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   173   174   175   176   177   178   179   180   ...   260
Bog'liq
Docker Cookbook

220 | Chapter 7: The Docker Ecosystem: Tools


Figure 7-8. Marathon UI for HTTP server
Let’s now move on to starting an application that is made of a Docker container. By
default, the VM started by Playa Mesos will contain Docker, but the Mesos slave is
not configured to use it. Therefore, you need to do a few configurations and restart
mesos-slave
. In the virtual machine, do the following:
vagrant@mesos:~$ sudo su
root@mesos:/home/vagrant# cd /etc/mesos-slave
root@mesos:/etc/mesos-slave# echo 'docker,mesos' > containerizers
root@mesos:/etc/mesos-salve# echo '5mins' > executor_registration_timeout
root@mesos:/etc/mesos-slave# service mesos-slave restart
mesos-slave stop/waiting
mesos-slave start/running, process 2581
Create the following JSON file (e.g., 
docker.json
) that describes running an Nginx
container with a dynamic port allocation on the host:
{
"container"
:
{
"type"
:
"DOCKER"
,
"docker"
:
{
"image"
:
"nginx"
,
"network"
:
"BRIDGE"
,
"portMappings"
:
[
{
"containerPort"
:
80
,
"hostPort"
:
0
}
]
}
},
"id"
:
"nginx"
,
"instances"
:
1
,
"cpus"
:
0.5
,
"mem"
:
512
}
Create this application via the Marathon API by using 
curl
and check the list of run‐
ning applications:
7.11 Running Containers via Apache Mesos and Marathon | 221


$ curl -si -H 'Content-Type: application/json'
-d @docker.json 10.141.141.10:8080/v2/apps
$ curl -sX GET -H "Content-Type: application/json" 10.141.141.10:8080/v2/tasks
| python -m json.tool
{

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   173   174   175   176   177   178   179   180   ...   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