mirror of
https://github.com/KevinMidboe/planetposen-images.git
synced 2025-10-28 21:00:12 +00:00
Build docker image from iron/go, saves so much build size
This commit is contained in:
@@ -10,7 +10,7 @@ RUN make build
|
|||||||
# RUN make test
|
# RUN make test
|
||||||
|
|
||||||
# Create production image for application with needed files
|
# Create production image for application with needed files
|
||||||
FROM golang:1.19-alpine
|
FROM iron/go
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -4,7 +4,7 @@ PROJECT_NAME=$(shell basename $(CURDIR))
|
|||||||
|
|
||||||
## build: build the application
|
## build: build the application
|
||||||
build:
|
build:
|
||||||
export GO111MODULE="on"; \
|
export GO111MODULE="auto"; \
|
||||||
go mod download; \
|
go mod download; \
|
||||||
go mod vendor; \
|
go mod vendor; \
|
||||||
CGO_ENABLED=0 go build -a -ldflags '-s' -installsuffix cgo -o main cmd/server/main.go
|
CGO_ENABLED=0 go build -a -ldflags '-s' -installsuffix cgo -o main cmd/server/main.go
|
||||||
|
|||||||
Reference in New Issue
Block a user