Reputation: 569
I have a code in golang that is using buildmode plugins. I am building the main program and the plugins inside the same image (goboring/golang:1.15.8b5) and one after the other. When running the main program, as soon as it tries to load the plugins, I get the error:
E0319 14:27:38.417362 34123 daemon.go:639] loadVendorPlugins(): fail to load plugin /plugins/my_plugin.so: plugin.Open("/plugins/my_plugin"): plugin was built with a different version of package crypto/internal/boring
This does not happen if I change the image to golang:1.15. Any idea why a different version for a package is found even if both are built in the same image? Why the base image might have an impact on this?
Upvotes: 0
Views: 929
Reputation: 569
Apparently, when using the buildmode=plugin, it is not strange to see this problem. The solution is to add the flag -trimpath
to the go build, as explained here: https://github.com/golang/go/issues/27751#issuecomment-593082117
Upvotes: 2