在高山Linux上使用libicu进行编译

I am trying to compile a go project with a dependency on golang.org/x/text/cases which is failing with:

# golang.org/x/text/cases 
/usr/lib/gcc/x86_64-alpine-linux-musl/6.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -licui18n.57
/usr/lib/gcc/x86_64-alpine-linux-musl/6.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -licuuc.57 
collect2: error: ld returned 1 exit status

It is being built with go-1.8.3 in an alpine docker container.

The icu packages I've installed are:

  • icu-libs-57.1-r3
  • icu-57.1-r3
  • icu-dev-57.1-r3

I've also tried with the these environment variables as well and it made no difference:

CGO_LDFLAGS=-L/usr/lib/icu -L/usr/lib/
CGO_CFLAGS=-I/usr/include/unicode -I/usr/include/layout
CGO_CPPFLAGS=-I/usr/include/unicode -I/usr/include/layout

No sure where else to look for what's wrong.

I do not need to use alpine specifically and was previously using only the compiled go binary (statically linked), but I have found having the distro available for runtime debugging invaluable.