Docker Cookbook


Managing and Configuring the Docker Daemon



Download 6,31 Mb.
Pdf ko'rish
bet95/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   91   92   93   94   95   96   97   98   ...   260
Bog'liq
Docker Cookbook

4.1 Managing and Configuring the Docker Daemon
Problem
You would like to start, stop, and restart the Docker daemon. Additionally, you would
like to configure it in specific ways, potentially changing things such as the path to the
Docker binary or using a different network bridge.
Solution
Use the 
docker
init script to manage the Docker daemon. On most Ubuntu/Debian-
based systems, it will be located in the 
/etc/init.d/docker
file. Like most other init serv‐
ices, it can be managed via the 
service
command. The Docker daemon runs as 
root
:
# service docker status
docker start/running, process 2851
# service docker stop
docker stop/waiting
# service docker start
docker start/running, process 3119
The configuration file is located in 
/etc/default/docker
. On Ubuntu systems, all config‐
uration variables are commented out. The 
/etc/default/docker
file looks like this:
# Docker Upstart and SysVinit configuration file
# Customize location of Docker binary (especially for development testing).
#DOCKER="/usr/local/bin/docker"
# Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"
# This is also a handy place to tweak where Docker's temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp"
For example, if you wanted to configure the daemon to listen on a TCP socket to
enable remote API access, you would edit this file as explained in 
Recipe 4.7
.
108 | Chapter 4: Docker Configuration and Development


Discussion
On 
systemd
-based systems like Ubuntu 15.05 or CentOS 7, you need to modify the
systemd
unit file for Docker. It can be located in the 
/etc/systemd/system/
docker.service.d
directory or it can be the 
/etc/systemd/system/docker.service
file. For
more details on Docker daemon configuration using 
systemd
, see this 
article
 from
the Docker documentation.
Finally, although you can start Docker as a Linux daemon, you can also start it inter‐
actively by using the 
docker -d
command or, starting with Docker 1.8, the 
docker
daemon
command. You would then pass the options directly to the command. Check
the help to see what options can be set:
$ docker daemon --help
Usage: docker daemon [OPTIONS]
Enable daemon mode
--api-cors-header= Set CORS headers in the remote API
-b, --bridge= Attach containers to a network bridge
--bip= Specify network bridge IP
-D, --debug=false Enable debug mode
--default-gateway= Container default gateway IPv4 address
...

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   91   92   93   94   95   96   97   98   ...   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