markbates / pkger

Embed static files in Go binaries (replacement for gobuffalo/packr)
MIT License
1.18k stars 60 forks source link

Pkger does not work in a scratch image #146

Open mmohaveri opened 3 years ago

mmohaveri commented 3 years ago

I'm trying to pack all of my SQL migrations into the final binary, when I do it in my local, or even in a docker image with golang:alpine as base everything works as planned. But as soon as I switch to to a docker image with scratch as base image I get the "no file or directory" error when trying to read the files using pkger API.

Here someone has mentioned that pkger requires golang in runtime, and as a result it won't work in any docker image that does not have golang installed, i.e. scratch. First of all, is it true, if yes, why is it necessary and how can we go around the issue? And finally I think something like this should have been mentioned in the readme or documentations.