Docker Cookbook


| Chapter 10: Application Use Cases



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

302 | Chapter 10: Application Use Cases


# Clean up the testing container
docker kill node_app_test
docker rm node_app_test
if [ $status -eq 0 ] ; then
echo "Test succeeded"
else
echo "Test failed"
fi
exit $status
push.sh
:
#!/bin/bash
# The first parameter passed to this script will be used as an image version.
# If none is passed, latest will be used as a tag.
if [ -z "${1}" ]; then
version="latest"
else
version="${1}"
fi
docker push localhost:5000/containersol/nodejs_app:"${version}"
Now you can build, test, and push the resulting image to a Docker registry by using
the following commands:
$ ./build.sh
$ ./test.sh
$ ./push.sh
Discussion
It is generally a good practice to have a consistent set of build, test, and deployment
commands that can be executed in any environment, including development
machines. This way, developers can test the application in exactly the same way as it is
going to be tested in the continuous integration environment and catch the problems
related to the environment itself at earlier stages.
This example uses simple shell scripts, but a more common way to achieve the same
results is to use build systems such as Maven or Gradle. Both systems have Docker
plug-ins and can be easily used to build and push the images, using the same build
interface already used for compiling and packaging the code.
Our current testing environment has only a single container, but in case you need a
multicontainer setup, you can use 
docker-compose
to set up the environment as well
as replace a simple 
curl
/
grep
combination with more-appropriate testing systems
such as Selenium. Selenium is also available in a Docker container and can be

Download 6,31 Mb.

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