Docker Cookbook


CI/CD: Building a Continuous Delivery Pipeline with Jenkins and Apache Mesos | 305



Download 6,31 Mb.
Pdf ko'rish
bet237/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   233   234   235   236   237   238   239   240   ...   260
Bog'liq
Docker Cookbook

10.2 CI/CD: Building a Continuous Delivery Pipeline with Jenkins and Apache Mesos | 305


and the containers running on it (with exception of 
root
, which always has ID 0). To
solve this, you can use 
root
to start the Jenkins server.
For this, you need to add a new 
user
instruction to 
docker-compose.yml
:
jenkins:
image: Jenkins
user: root
volumes:
- jenkins-home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
ports:

"8080:8080"
Now, when you have a functional Jenkins server, you can deploy the Node.js applica‐
tion described in 
Recipe 10.1
.
In the Node.js recipe, you already have scripts to build, test, and push the image to a
Docker registry. You need to add a configuration file to schedule the application on
Mesos, using Marathon and another script to deploy the application.
You call the application configuration for Marathon 
app_marathon.json
:
{
"id"
:
"app"
,
"container"
:
{
"docker"
:
{
"image"
:
"localhost:5000/containersol/nodejs_app:latest"
,
"network"
:
"BRIDGE"
,
"portMappings"
:
[
{
"containerPort"
:
8000
,
"servicePort"
:
8000
}
]
}
},
"cpus"
:
0.2
,
"mem"
:
512.0
,
"instances"
:
1
}
This configuration uses our application Docker image that you are going to build
using Jenkins and deploy it on Mesos by using Marathon. This file also defines the
resources needed for your application and can also include a health check.
The last piece of the configuration is the deployment script that you are going to run
from Jenkins.
deploy.sh
:
#!/bin/bash
marathon=

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   233   234   235   236   237   238   239   240   ...   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