mirror of
https://github.com/absmach/magistrala.git
synced 2026-06-22 20:00:22 +00:00
NOISSUE - Remove Make and UPX dependencies in build
Signed-off-by: dusan <borovcanindusan1@gmail.com>
This commit is contained in:
@@ -64,6 +64,7 @@ define make_docker
|
||||
--build-arg VERSION=$(VERSION) \
|
||||
--build-arg COMMIT=$(COMMIT) \
|
||||
--build-arg TIME=$(TIME) \
|
||||
--build-arg BUILD_TAGS="$(BUILD_TAGS)" \
|
||||
--tag=$(MG_DOCKER_IMAGE_NAME_PREFIX)/$(svc) \
|
||||
-f docker/Dockerfile .
|
||||
endef
|
||||
|
||||
+12
-5
@@ -8,14 +8,21 @@ ARG GOARM
|
||||
ARG VERSION
|
||||
ARG COMMIT
|
||||
ARG TIME
|
||||
ARG BUILD_TAGS
|
||||
|
||||
WORKDIR /go/src/github.com/absmach/magistrala
|
||||
COPY . .
|
||||
RUN apk update \
|
||||
&& apk add make upx\
|
||||
&& make $SVC \
|
||||
&& upx build/$SVC \
|
||||
&& mv build/$SVC /exe
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${GOARCH} GOARM=${GOARM} \
|
||||
go build \
|
||||
-trimpath \
|
||||
-mod=readonly \
|
||||
-buildvcs=false \
|
||||
-tags "${BUILD_TAGS}" \
|
||||
-ldflags "-s -w \
|
||||
-X 'github.com/absmach/magistrala.BuildTime=${TIME}' \
|
||||
-X 'github.com/absmach/magistrala.Version=${VERSION}' \
|
||||
-X 'github.com/absmach/magistrala.Commit=${COMMIT}'" \
|
||||
-o /exe cmd/${SVC}/main.go
|
||||
|
||||
FROM scratch
|
||||
# Certificates are needed so that mailing util can work.
|
||||
|
||||
Reference in New Issue
Block a user