I am pretty new to GoLang. I have a pretty simple dockerFile that is trying to build a goLang webservice.
FROM golang:alpine
WORKDIR /app/webservice_refArch
ADD . /app/webservice_refArch
RUN apk add git
RUN apk upgrade
RUN cd /app/webservice_refArch/ && go get webservice_refArch/restapi
RUN cd /app/webservice_refArch/cmd/reference-w-s-server && go build -o ../../server
ENTRYPOINT ./goapp
When the build runs it cannot find a local import.
go get webservice_refArch/restapi
The error that I get is:
package webservice_refArch/restapi: unrecognized import path "webservice_refArch/restapi" (import path does not begin with hostname)
When I run that same command on my local (in the same folder) it runs just fine. I am sure that I am missing something stupid but any thoughts on why it fails when running from docker would be appreciated.