Error stacktraces reported by dockerized Go program cannot show original code


Program built by Go docker image cannot show source code in Stacktrace.


package main

import (

	raven ""

func init() {

func main() {
	_, err := os.Open("filename.ext")
	fmt.Println(raven.CaptureErrorAndWait(err, nil))

Then I build a binary with following docker command:

docker run --rm -v ~/go:/go -v $PWD:/go/src/ -w /go/src/ golang:1.8 go build

Is there anyone meet this problem?


The source code needs to be available at runtime by the binary. If it’s not, we can’t get it for, just the binary itself.

Got it, thanks. Then I’ll find another way to deploy our program.

Just a wild idea, but if you clean the project before building it in the container, that might fix possibly embedded source file paths. At least that would be the case for Python and *.pyc files.

What do you mean “clean”? Thanks

The file paths has no problem, the only problem is not showing source code.