On Sun, Dec 25, 2016, 2:43 PM James Pettyjohn <japettyj...@gmail.com> wrote:
> Hi Justin, > > Thanks for the holiday reply. > > The ultimate goal in this was deployment into docker as a self contained > binary, no dynamic library dependencies and no parent image. The most > common solution to this I've seen is disable CGO altogether but with the > libraries I'm using this is not an option at this time. > Right. But you still need cgo for the C dependency so there is no way to disable it. You can only statically link as much as possible. I can't confirm right now but I think that may still leave you with a libc dynamic link at the very least > Best, > James > > On Saturday, December 24, 2016 at 5:36:48 PM UTC-8, Justin Israel wrote: > > > > On Sun, Dec 25, 2016 at 9:22 AM James Pettyjohn <japet...@gmail.com> > wrote: > > I've been looking at a number of articles on statically linking go files > by disabling CGO, sounds great except I've got a libsass dependency until > the native libsass is ready. > > Can this be in a straightforward manner with go 1.6/1.7 on linux (centos)? > > > Are you asking about statically linking libsass? > > In addition to other flags to statically link your Go binary, you can tell > cgo to statically link libsass: > > $ export CGO_LDFLAGS="\ > -Wl,-Bstatic \ > `pkg-config --libs libsass` \ > -lotherDep -lotherDep2 > -Wl,-Bdynamic" > > > > - Justin > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts...@googlegroups.com. > > > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.