From 98c4cd540a7a8e2e9be3e43c18e503cf283a3396 Mon Sep 17 00:00:00 2001 From: Asara Date: Thu, 26 Aug 2021 19:21:40 -0400 Subject: [PATCH] Clean up golang alpine, update to newer version of go --- docker/sudoscientist-go-backend/Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docker/sudoscientist-go-backend/Dockerfile b/docker/sudoscientist-go-backend/Dockerfile index 40f1f07..ad1b391 100644 --- a/docker/sudoscientist-go-backend/Dockerfile +++ b/docker/sudoscientist-go-backend/Dockerfile @@ -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