Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 96b4c03

Browse files
committed
modify fix docker log bug
1 parent 4f64b76 commit 96b4c03

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

‎README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,20 @@ yum install -y yum-utils device-mapper-persistent-data lvm2
5757
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
5858
yum install -y docker-ce
5959
```
60+
2. 配置容器日志
61+
```shell
62+
cat > /etc/docker/daemon.json << EOF
63+
{
64+
"log-driver": "json-file",
65+
"log-opts": {
66+
"max-size": "50m",
67+
"max-file": "1"
68+
}
69+
}
70+
EOF
71+
```
6072

61-
2. 启动 docker
73+
3. 启动 docker
6274
```shell
6375
# centos7+
6476
systemctl enable docker # 开机自启
@@ -67,21 +79,21 @@ systemctl start docker # 启动
6779
docker -v
6880
```
6981

70-
3. 安装 docker-compose
82+
4. 安装 docker-compose
7183
```shell
7284
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
7385
chmod +x /usr/local/bin/docker-compose
7486
```
7587

76-
4. 启动 php-nginx
88+
5. 启动 php-nginx
7789
```shell
7890
# cd 到 www 目录,拉取代码
7991
# 新增 nginx/conf.d/${appName}.conf,配置虚拟主机
8092
# 新增 ningx/logs/${appName},创建应用 nginx 日志目录
8193
docker-compose up -d --build
8294
```
8395

84-
5. 配置 nginx 日志切割
96+
6. 配置 nginx 日志切割
8597
```
8698
# chmod +x sh/docker_nginx_log_cutting.sh
8799
# crontab

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /