Docker 中的 Varnish 4.1 段错误

Docker 中的 Varnish 4.1 段错误

我正在尝试将 Varnish 4.1 与 Docker (1.9.1) 一起使用。我在 Alpine Linux 3.2 中使用其 musl-libc 构建了一个 docker 映像,以减小映像大小。

Dockerfile:

FROM alpine:3.2
RUN echo 'http://dl-4.alpinelinux.org/alpine/v3.3/main' >> /etc/apk/repositories && \
    apk update && apk upgrade -U -a && \
    apk add --update varnish \
    && rm -rf /var/cache/apk/*
Add Comment

当我尝试在容器内运行时,有时会出现段错误,但有时不会:

# varnishd -F -W epoll -f /etc/varnish/default.vcl
child (4081) Started
Pushing vcls failed:
CLI communication error (hdr)
Stopping Child
Child (4081) died signal=11
Child (4081) Panic message:
Assert error in child_sigsegv_handler(), mgt/mgt_child.c line 297:
  Condition(Segmentation fault by instruction at 0x7f8bec8af9e8) not true.
version = varnish-4.1.0 revision 3041728
ident = Linux,3.13.0-66-generic,x86_64,-junix,-smalloc,-smalloc,-hcritbit,epoll
Could not create _.vsm.4071: File exists

有时当我连续遇到 2-3 次段错误并且第 3 次、第 4 次时它可以成功运行。

我的环境:

# gcc --version
gcc (Alpine 5.2.0) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.2.3
PRETTY_NAME="Alpine Linux v3.2"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"
# ldd --version
musl libc
Version 1.1.12

# docker version
Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 13:12:04 UTC 2015
 OS/Arch:      linux/amd64
Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 13:12:04 UTC 2015
 OS/Arch:      linux/amd64

另外,当我成功运行它并尝试清除缓存(禁止)时,子进程因段错误而退出。

这是由 musl-libc 引起的吗?

答案1

遇到了完全相同的问题。似乎来自 alpine 图像。切换到 ubuntu 后,它运行良好。

相关内容