Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure the Docker daemon

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to configure the Docker daemon, which has a certain reference value. Interested friends can refer to it. I hope you can learn a lot after reading this article.

Install Docker and start it, and there is always a Docker daemon, dockerd, running on the server where Docker is located.

To start the Docker daemon manually by default, you only need to execute the following command:

Dockerd

To stop the above process, all you need is the CTRL+C keyboard command.

1. Configuration file for dockerd

If you want to start the Docker daemon with non-default configuration parameters, you can set the startup options for the dockerd command when you start the Docker daemon, but obviously this requires notifying dockerd before starting dockerd.

If you want to change the configuration parameters of dockerd without stopping dockerd, it is recommended to use a configuration file (JSON format).

Default configuration file / etc/docker/daemon.json for the Docker daemon. It may not exist initially and can be created manually.

If you want to use a different configuration file, you need to give the path to the configuration file when you start dockerd:

Dockerd-config-file path_to_your_config_file

Example: turn on debug mode of dockerd through configuration file

1) Edit configuration file

Vi / etc/docker/daemon.json

{"debug": true}

2) reload the configuration (do not restart dockerd)

Sudo kill-SIGHUP $(pidof dockerd)

In this way, you can see the debug log information in the default log file / var/log/messages of the Docker daemon.

2. Dockerd's log

The log level of dockerd defaults to info.

To change the log of dockerd to debug, in addition to the above usage configuration file, you can also restart dockerd and provide the startup parameter-D or-- debug. The example is as follows:

Dockerd-D

The log file of dockerd, which defaults to / var/log/messages, can also be redirected to other log files, as shown in the following example:

Dockerd-D > > log_file 2 > & 1

3. Log level of dockerd

Dockerd supports log levels debug, info, warn, error, fatal. The default log level is info.

If necessary, you also need to set the log level, either through the configuration file or through the startup parameter-l or-- log-level.

Method 1: configuration file / etc/docker/daemon.json

{"log-level": "debug"}

Method 2:

Dockerd-log-level debug dockerd-l debug Thank you for reading this article carefully. I hope the article "how to configure the Docker daemon" shared by the editor will be helpful to you. At the same time, I also hope you will support us and follow the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report