Docker Cookbook


| Chapter 1: Getting Started with Docker



Download 6,31 Mb.
Pdf ko'rish
bet16/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   12   13   14   15   16   17   18   19   ...   260
Bog'liq
Docker Cookbook

4 | Chapter 1: Getting Started with Docker


With a working 
VirtualBox
 and 
Vagrant
 installation, create a text file called 
Vagrant‐
file
that contains the following:
VAGRANTFILE_API_VERSION
=
"2"
$bootstrap
=<<
SCRIPT
apt
-
get
update
apt
-
get
-
y
install
wget
wget
-
qO
-
https
:
//
get
.
docker
.
com
/
|
sh
gpasswd
-
a
vagrant
docker
service
docker
restart
SCRIPT
Vagrant
.
configure
(
VAGRANTFILE_API_VERSION
)
do
|
config
|
config
.
vm
.
box
=
"ubuntu/trusty64"
config
.
vm
.
network
"private_network"
,
ip
:
"192.168.33.10"
config
.
vm
.
provider
"virtualbox"
do
|
vb
|
vb
.
customize
[
"modifyvm"
,
:id
,
"--memory"
,
"1024"
]
end
config
.
vm
.
provision
:shell
,
inline
:
$bootstrap
end
You can then bring up the virtual machine. Vagrant will download the 
ubuntu/
trusty64
 box from the 
Vagrant cloud
 (now part of 
Atlas
), start an instance of it using
VirtualBox, and run the bootstrap script in the instance. The instance will have 1GB
of RAM and two network interfaces: a Network Address Translation (NAT) interface
that will be used for outbound traffic to the public Internet and a host-only interface
192.168.33.10
. You will then be able to 
ssh
to the instance and use Docker:
$ vagrant up
$ vagrant ssh
vagrant@vagrant-ubuntu-trusty-64:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
In this Vagrant setup, the vagrant user was added to the Docker
group. Hence Docker commands can be issued even if you are not
root. You can get these scripts from the how2dock 
repository
in the
ch01
directory.
Discussion
If you have never used Vagrant, you will need to install it. The 
download page on the
Vagrant website
 lists all major package families. For example, on Debian-based sys‐
tems, grab the 
.deb
package and install it like so:

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   12   13   14   15   16   17   18   19   ...   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