Docker 容器在 nginx 重新启动时崩溃



Nginx被设置为运行laravel,只有当我尝试在容器内重新启动nginx时,问题才会出现。然后它会停止容器而不在docker log中记录任何内容。

然后,本地计算机在/var/crash中出现_sbin_auplin.0.crashSystem program problem detected

这是崩溃文件的内容

ProblemType: Crash
Architecture: amd64
Date: Thu Jul 13 13:29:33 2017
DistroRelease: Ubuntu 17.04
ExecutablePath: /sbin/auplink
ExecutableTimestamp: 1453488440
ProcCmdline: auplink /var/lib/docker/aufs/mnt/a33d46e2ea4abfea807913ac65b8f3af701f9f74462b4bfa305255bce7f3f523 flush
ProcCwd: /var/lib/docker/aufs/mnt/a33d46e2ea4abfea807913ac65b8f3af701f9f74462b4bfa305255bce7f3f523
ProcEnviron:
LANG=en_ZA.UTF-8
LANGUAGE=en_ZA:en
PATH=(custom, no user)
ProcMaps:
00400000-00403000 r-xp 00000000 08:11 2753135                            /sbin/auplink
00602000-00603000 r--p 00002000 08:11 2753135                            /sbin/auplink
00603000-00604000 rw-p 00003000 08:11 2753135                            /sbin/auplink
00ac1000-00ae2000 rw-p 00000000 00:00 0                                  [heap]
7fbe2f8b4000-7fbe2fa72000 r-xp 00000000 08:11 918608                     /lib/x86_64-linux-gnu/libc-2.24.so
7fbe2fa72000-7fbe2fc71000 ---p 001be000 08:11 918608                     /lib/x86_64-linux-gnu/libc-2.24.so
7fbe2fc71000-7fbe2fc75000 r--p 001bd000 08:11 918608                     /lib/x86_64-linux-gnu/libc-2.24.so
7fbe2fc75000-7fbe2fc77000 rw-p 001c1000 08:11 918608                     /lib/x86_64-linux-gnu/libc-2.24.so
7fbe2fc77000-7fbe2fc7b000 rw-p 00000000 00:00 0 
7fbe2fc7b000-7fbe2fca1000 r-xp 00000000 08:11 918600                     /lib/x86_64-linux-gnu/ld-2.24.so
7fbe2fe7a000-7fbe2fe7c000 rw-p 00000000 00:00 0 
7fbe2fe9d000-7fbe2fea0000 rw-p 00000000 00:00 0 
7fbe2fea0000-7fbe2fea1000 r--p 00025000 08:11 918600                     /lib/x86_64-linux-gnu/ld-2.24.so
7fbe2fea1000-7fbe2fea2000 rw-p 00026000 08:11 918600                     /lib/x86_64-linux-gnu/ld-2.24.so
7fbe2fea2000-7fbe2fea3000 rw-p 00000000 00:00 0 
7fffe3da5000-7fffe3dc6000 rw-p 00000000 00:00 0                          [stack]
7fffe3dea000-7fffe3dec000 r--p 00000000 00:00 0                          [vvar]
7fffe3dec000-7fffe3dee000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
ProcStatus:
Name:  auplink
Umask: 0022
State: S (sleeping)
Tgid:  24035
Ngid:  0
Pid:   24035
PPid:  1183
TracerPid: 0
Uid:   0   0   0   0
Gid:   0   0   0   0
FDSize:    64
Groups:     
NStgid:    24035
NSpid: 24035
NSpgid:    1183
NSsid: 1183
VmPeak:        4356 kB
VmSize:        4352 kB
VmLck:        0 kB
VmPin:        0 kB
VmHWM:     1060 kB
VmRSS:     1060 kB
RssAnon:         84 kB
RssFile:        976 kB
RssShmem:         0 kB
VmData:         188 kB
VmStk:      132 kB
VmExe:       12 kB
VmLib:     1944 kB
VmPTE:       32 kB
VmPMD:       12 kB
VmSwap:           0 kB
HugetlbPages:         0 kB
Threads:   1
SigQ:  0/31496
SigPnd:    0000000000000000
ShdPnd:    0000000000000000
SigBlk:    0000000000000000
SigIgn:    0000000000000000
SigCgt:    0000000000000000
CapInh:    0000000000000000
CapPrm:    0000003fffffffff
CapEff:    0000003fffffffff
CapBnd:    0000003fffffffff
CapAmb:    0000000000000000
NoNewPrivs:    0
Seccomp:   0
Cpus_allowed:  f
Cpus_allowed_list: 0-3
Mems_allowed:  00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
Mems_allowed_list: 0
voluntary_ctxt_switches:   2
nonvoluntary_ctxt_switches:    0
Signal: 11
Uname: Linux 4.10.0-26-generic x86_64
UserGroups: 
CoreDump: base64

这是我正在使用的配置

server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /app/public;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html index.php;
server_name _;
client_max_body_size 500M;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404 /index.php?$query_string;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ .php$ {
include snippets/fastcgi-php.conf;
# With php7.0-cgi alone:
#   fastcgi_pass 127.0.0.1:9000;
# With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /.ht {
#   deny all;
#}
}

# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#   listen 80;
#   listen [::]:80;
#
#   server_name example.com;
#
#   root /var/www/example.com;
#   index index.html;
#
#   location / {
#       try_files $uri $uri/ =404;
#   }
#}

提前感谢您的任何帮助

您不重新启动容器内的进程,而是重新启动容器。请参阅使用 docker 部署 NGINX(官方图片(的提示(原始大写(:

由于我们无法直接访问 NGINX 容器的命令行,因此我们不能使用 nginx 命令来控制 NGINX。幸运的是,NGINX可以通过信号控制,Docker提供了将信号发送到容器的kill命令。例如,要重新加载 NGINX 配置,请运行以下命令:

docker kill -s HUP <container name>

如果要重新启动 NGINX 进程,请通过运行以下命令重新启动容器:

docker restart <container name>

最新更新