I am facing the same issue while trying to package our FoundationDB client program in a container, and have not found a working solution for this after hours of frustration. My Dockerfile looks somewhat like this
RUN apt-get update && apt-get install -y git golang-go wget
# Command line arguments for the go build
ENV GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GOPATH=/go/ GOBIN=/go/bin
# Install FoundationDB client libraries
RUN wget https://www.foundationdb.org/downloads/5.2.5/ubuntu/installers/foundationdb-clients_5.2.5-1_amd64.deb && dpkg -i foundationdb-clients_5.2.5-1_amd64.deb && rm foundationdb-clients_5.2.5-1_amd64.deb
# Add example program
ADD src/main.go /go/src/main.go
src/main.go file is just the example file from godoc with the apiversion 520 instead of 200. In reality our own codebase is there in the
Build this and start a container:
docker build -t test .
docker run -it -w /go/src/ test /bin/bash
Now try a go get, this results:
root@dd4d269335a2:/go/src# go get
github.com/apple/foundationdb/bindings/go/src/fdb/generated.go:48:9: undefined: NetworkOptions
This doesn’t get solved when doing a checkout of the
release-5.1 or any other branch as some issues are related to that (see github).
Additionally I can run using the go bindings on my Mac just fine, but when I try to compile for Linux directly on it (instead of in the Docker container) I get the same error.