1

I'm trying to compile gogs with the sqlite tag for alpine, I need to create a statically linked bin because otherwise I get a file not found if I try to run the ADD'ed bin from within an alpine container.

Here's what I'm doing:

  1. Cloning the develop branch from the gogs repo git clone --depth=1 -b develop https://github.com/gogits/gogs

  2. cd to run the build cd gogs

  3. Trying a go get with CGO_ENABLED CGO_ENABLED=0 go get -a -ldflags '-s' -tags "sqlite" -u ./...

And I get:

error: pathspec 'master' did not match any file(s) known to git.
package github.com/gogits/gogs: exit status 1
package github.com/mattn/go-sqlite3: C source files not allowed when not using cgo or SWIG: sqlite3-binding.c
Jonathan
  • 10,792
  • 5
  • 65
  • 85
  • 2
    gogs requires CGO for the SQLite package. You can't build it without CGO. – JimB Aug 28 '16 at 13:54
  • Just use the Debian image. It's not that huge (~150MB) and it contains libc (which allows you to use CGO). – Bernard Aug 28 '16 at 14:19

0 Answers0