You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Dockerfile for the Go version of this sample uses the latest version of golang:alpine which causes issues for the RUN go get -d -v command. It generates the error:
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
Tie the version of golang:alpine image to a version round about the same time as this sample was created and ensure that the AWS SDK versions are from the same time from too. This prevents the error as that version of Go (presumably) doesn't have all the latest module handling in it. Change the Dockerfile to:
`FROM golang:1.15-alpine AS builder
WORKDIR /go/src/app
COPY ./service/ .
RUN echo Fetching project dependencies
RUN go mod init
RUN go get -v "github.com/aws/aws-sdk-go/[email protected]"
RUN go get -v "github.com/aws/aws-sdk-go/aws/[email protected]"
RUN go get -v "github.com/aws/aws-sdk-go/service/[email protected]"
RUN go get -v "github.com/aws/aws-sdk-go/service/dynamodb/[email protected]"
RUN echo Building and installing Mystical Mysfits Service
RUN go install -v
FROM alpine AS app
COPY --from=builder /go/bin/app /bin/app
COPY --from=builder /go/src/app/mysfits-response.json /mysfits-response.json
EXPOSE 8080
RUN echo Starting the Go service...
CMD ["app"]`
The text was updated successfully, but these errors were encountered:
The Dockerfile for the Go version of this sample uses the latest version of golang:alpine which causes issues for the RUN go get -d -v command. It generates the error:
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
Tie the version of golang:alpine image to a version round about the same time as this sample was created and ensure that the AWS SDK versions are from the same time from too. This prevents the error as that version of Go (presumably) doesn't have all the latest module handling in it. Change the Dockerfile to:
`FROM golang:1.15-alpine AS builder
WORKDIR /go/src/app
COPY ./service/ .
RUN echo Fetching project dependencies
RUN go mod init
RUN go get -v "github.com/aws/aws-sdk-go/[email protected]"
RUN go get -v "github.com/aws/aws-sdk-go/aws/[email protected]"
RUN go get -v "github.com/aws/aws-sdk-go/service/[email protected]"
RUN go get -v "github.com/aws/aws-sdk-go/service/dynamodb/[email protected]"
RUN echo Building and installing Mystical Mysfits Service
RUN go install -v
FROM alpine AS app
COPY --from=builder /go/bin/app /bin/app
COPY --from=builder /go/src/app/mysfits-response.json /mysfits-response.json
EXPOSE 8080
RUN echo Starting the Go service...
CMD ["app"]`
The text was updated successfully, but these errors were encountered: