The simplest Golang Dockerfile Setup

in #docker3 years ago (edited)

FROM golang:1.16.7-alpine AS builder git is needed to download those packages use this if u called to any https service RUN apk --update add --no-cache ca-certificates openssl git && update-ca-certificates without ssl RUN apk --update add --no-cache git WORKDIR /app copy go.mod ./ copy go.sum ./ RUN go mod download