Merge pull request #3022 from aledbf/valgrind-support
Add support for valgrind
This commit is contained in:
commit
d791b15210
2 changed files with 17 additions and 1 deletions
|
@ -74,14 +74,29 @@ const (
|
||||||
cfgPath = "/etc/nginx/nginx.conf"
|
cfgPath = "/etc/nginx/nginx.conf"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var valgrind = []string{
|
||||||
|
"valgrind",
|
||||||
|
"--tool=memcheck",
|
||||||
|
"--leak-check=full",
|
||||||
|
"--show-leak-kinds=all",
|
||||||
|
"--leak-check=yes",
|
||||||
|
}
|
||||||
|
|
||||||
func nginxExecCommand(args ...string) *exec.Cmd {
|
func nginxExecCommand(args ...string) *exec.Cmd {
|
||||||
ngx := os.Getenv("NGINX_BINARY")
|
ngx := os.Getenv("NGINX_BINARY")
|
||||||
if ngx == "" {
|
if ngx == "" {
|
||||||
ngx = defBinary
|
ngx = defBinary
|
||||||
}
|
}
|
||||||
|
|
||||||
cmdArgs := []string{"--deep", ngx, "-c", cfgPath}
|
cmdArgs := []string{"--deep"}
|
||||||
|
|
||||||
|
if os.Getenv("RUN_WITH_VALGRIND") == "true" {
|
||||||
|
cmdArgs = append(cmdArgs, valgrind...)
|
||||||
|
}
|
||||||
|
|
||||||
|
cmdArgs = append(cmdArgs, ngx, "-c", cfgPath)
|
||||||
cmdArgs = append(cmdArgs, args...)
|
cmdArgs = append(cmdArgs, args...)
|
||||||
|
|
||||||
return exec.Command("authbind", cmdArgs...)
|
return exec.Command("authbind", cmdArgs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ WORKDIR /etc/nginx
|
||||||
|
|
||||||
RUN clean-install \
|
RUN clean-install \
|
||||||
diffutils \
|
diffutils \
|
||||||
|
valgrind \
|
||||||
dumb-init
|
dumb-init
|
||||||
|
|
||||||
COPY . /
|
COPY . /
|
||||||
|
|
Loading…
Reference in a new issue