Showing results for 
Search instead for 
Did you mean: 

Driver & Docker Headache

No I have been trying to dockerize my go api which is supposed to use the new driver to connect to a database installed in another container. I have followed an article and thanks to the author, I was able to build the application using docker-compose but when running I get this error

cannot find package "" in any of:
/usr/local/go/src/ (from $GOROOT)
/go/src/ (from $GOPATH)

From my findings, the app can't find the package which was imported. Below is my dockerfile --

# start from golang image based on alpine-3.8
FROM golang:1.10-alpine3.8 AS dev-build

# add our cgo dependencies
RUN apk add --update --no-cache ca-certificates cmake make g++ openssl-dev git curl pkgconfig
# clone seabolt-1.7.0 source code
RUN git clone -b v1.7.0 /seabolt 
# invoke cmake build and install artifacts - default location is /usr/local
WORKDIR /seabolt/build
# CMAKE_INSTALL_LIBDIR=lib is a hack where we override default lib64 to lib to workaround a defect
# in our generated pkg-config file 
RUN cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_LIBDIR=lib .. && cmake --build . --target install

# install dep
RUN curl | sh

WORKDIR /go/src/app
ADD . /go/src/app

# install dependencies
RUN dep init && dep ensure -add

# Install Dependencies
RUN go get
RUN go get
RUN go get
RUN go get
RUN go get
RUN go get
RUN go get
RUN go get

CMD ["go", "run", "main.go"]

Thank you for your help

  • Go

Node Clone

@ali.ince, you might be able to help out.

I was able to get help from @ali.ince. Check out this link if you are interested,