aws-samples / ecs-refarch-cloudformation

A reference architecture for deploying containerized microservices with Amazon ECS and AWS CloudFormation (YAML)
Apache License 2.0
1.69k stars 1.32k forks source link

make fails for both product-service and website-service #78

Open mrichman opened 6 years ago

mrichman commented 6 years ago

It looks like the gin dependency is not being pulled into the containers at make time:

make
Building Linux binary ready for containerisation...
docker run --rm -it -v "":/gopath -v "/User/Mark/github/aws-samples/ecs-refarch-cloudformation/services/product-service/src":/app -e "GOPATH=/gopath" -w /app golang:1.7 sh -c 'CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o app'
main.go:3:8: cannot find package "github.com/gin-gonic/gin" in any of:
        /usr/local/go/src/github.com/gin-gonic/gin (from $GOROOT)
        /gopath/src/github.com/gin-gonic/gin (from $GOPATH)
make: *** [binary] Error 1

I have the following paths shared in Docker:

/User/Mark/github/aws-samples/ecs-refarch-cloudformation/services/product-service/src
/User/Mark/github/aws-samples/ecs-refarch-cloudformation/services/website-service/src

Running Docker Version 18.03.1-ce-mac65 (24312) on macOS High Sierra

mrichman commented 6 years ago

Line 17 of the Makefile needs to call go get github.com/gin-gonic/gin:

docker run --rm -it -v "${GOPATH}":/gopath -v "$(CURDIR)":/app -e "GOPATH=/gopath" -w /app golang:1.10 sh -c 'go get -u -v github.com/gin-gonic/gin && CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o app'

sushovannits commented 5 years ago

Completely new to go and scratching my head over how to make this work. Spent hours but getting one error after another.