Docker Cookbook


| Chapter 2: Image Creation and Sharing



Download 6,31 Mb.
Pdf ko'rish
bet44/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   40   41   42   43   44   45   46   47   ...   260
Bog'liq
Docker Cookbook

42 | Chapter 2: Image Creation and Sharing


Once your first build is done, a new image is created with, in this case, the ID
e778362ca7cf. Note that no repository or tag is defined because you did not specify
any. You can rebuild the image with the repository cookbook as the name and the tag
hello
, using the 
-t
option of 
docker build
. As long as you are doing this locally, the
choice of repository and tag is up to you, but once you start publishing this image
into a registry, you will need to follow a naming convention.
$ docker build -t cookbook:hello .
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
cookbook hello e778362ca7cf 4 days ago 192.7 MB
ubuntu 14.04 9bd07e480c5b 10 days ago 192.7 MB
The docker 
build
command has a couple of options to deal with
intermediate containers:
$ docker build -h
Usage: docker build [OPTIONS] PATH | URL | -
Build a new image from the source code at PATH
--force-rm=false Always remove intermediate containers...
--no-cache=false Do not use cache when building the ...
-q, --quiet=false Suppress the verbose output generated...
--rm=true Remove intermediate containers after ...
-t, --tag="" Repository name (and optionally a tag)...
See Also
• Dockerfile 
reference
• Best practices for writing a 
Dockerfile
• The CentOS project’s large set of 
Dockerfiles
2.4 Packaging a Flask Application Inside a Container
Problem
You have a web application built with the Python framework 
Flask
, running in
Ubuntu 14.04. You want to run this application in a container.
Solution
As an example, you are going to use the simple 
Hello World
 application defined by
the following Python script:

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   40   41   42   43   44   45   46   47   ...   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