The simplest Golang Dockerfile Setup

Words
50
Reading
1 min
Listen
Play
4y

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

The simplest Golang Dockerfile Setup | Ecency