From 9486ad1069d90952ecb60c9d3514a958a3b3f011 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 17 Dec 2022 14:24:02 +0100 Subject: [PATCH] Build docker image from iron/go, saves so much build size --- Dockerfile | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b1567c8..6d6f3f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN make build # RUN make test # Create production image for application with needed files -FROM golang:1.19-alpine +FROM iron/go EXPOSE 8000 diff --git a/Makefile b/Makefile index 47149b2..34412f6 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ PROJECT_NAME=$(shell basename $(CURDIR)) ## build: build the application build: - export GO111MODULE="on"; \ + export GO111MODULE="auto"; \ go mod download; \ go mod vendor; \ CGO_ENABLED=0 go build -a -ldflags '-s' -installsuffix cgo -o main cmd/server/main.go