moves prod images build into alpine container with musl (#1640)

adds gcc and musl-dev to builder container
This commit is contained in:
Nikolay 2021-09-24 00:14:11 +03:00 committed by GitHub
parent 9f19649672
commit 3f1e6da1d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -4,7 +4,7 @@ DOCKER_NAMESPACE := victoriametrics
ROOT_IMAGE ?= alpine:3.14.2 ROOT_IMAGE ?= alpine:3.14.2
CERTS_IMAGE := alpine:3.14.2 CERTS_IMAGE := alpine:3.14.2
GO_BUILDER_IMAGE := golang:1.17.1 GO_BUILDER_IMAGE := golang:1.17.1-alpine
BUILDER_IMAGE := local/builder:2.0.0-$(shell echo $(GO_BUILDER_IMAGE) | tr : _) BUILDER_IMAGE := local/builder:2.0.0-$(shell echo $(GO_BUILDER_IMAGE) | tr : _)
BASE_IMAGE := local/base:1.1.3-$(shell echo $(ROOT_IMAGE) | tr : _)-$(shell echo $(CERTS_IMAGE) | tr : _) BASE_IMAGE := local/base:1.1.3-$(shell echo $(ROOT_IMAGE) | tr : _)-$(shell echo $(CERTS_IMAGE) | tr : _)
@ -36,7 +36,7 @@ app-via-docker: package-builder
$(BUILDER_IMAGE) \ $(BUILDER_IMAGE) \
go build $(RACE) -mod=vendor -trimpath \ go build $(RACE) -mod=vendor -trimpath \
-ldflags "-extldflags '-static' $(GO_BUILDINFO)" \ -ldflags "-extldflags '-static' $(GO_BUILDINFO)" \
-tags 'netgo osusergo nethttpomithttp2' \ -tags 'netgo osusergo nethttpomithttp2 musl' \
-o bin/$(APP_NAME)$(APP_SUFFIX)-prod $(PKG_PREFIX)/app/$(APP_NAME) -o bin/$(APP_NAME)$(APP_SUFFIX)-prod $(PKG_PREFIX)/app/$(APP_NAME)
app-via-docker-windows: package-builder app-via-docker-windows: package-builder

View file

@ -1,3 +1,4 @@
ARG go_builder_image ARG go_builder_image
FROM $go_builder_image FROM $go_builder_image
STOPSIGNAL SIGINT STOPSIGNAL SIGINT
RUN apk add gcc musl-dev make --no-cache