Clean up golang alpine, update to newer version of go

This commit is contained in:
Amarpreet Minhas 2021-08-26 19:21:40 -04:00
parent 38b8ee075f
commit 98c4cd540a

View file

@ -1,14 +1,12 @@
FROM golang:alpine
FROM golang:1.17-alpine3.14
# add ca-certificates package
RUN apk add --no-cache ca-certificates git && \
go get -u -d github.com/mattes/migrate/cli github.com/lib/pq && \
go build -tags 'postgres' -o ${GOPATH}/bin/migrate github.com/mattes/migrate/cli && \
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest && \
mkdir -p ${GOPATH}/src/git.minhas.io/asara && \
cd ${GOPATH}/src/git.minhas.io/asara && \
git clone https://git.minhas.io/asara/sudoscientist-go-backend && \
cd ${GOPATH}/src/git.minhas.io/asara/sudoscientist-go-backend && \
go get && go build main.go && \
go mod init && go get && go build main.go && \
mv /go/bin/* /usr/local/bin/ && \
rm -rf /go/src && \
apk del git