NOISSUE - Remove Make and UPX dependencies in build

Signed-off-by: dusan <borovcanindusan1@gmail.com>
This commit is contained in:
dusan
2026-04-07 13:28:57 +02:00
parent 6c7e5d893d
commit c5fc0b64d4
2 changed files with 13 additions and 5 deletions
+1
View File
@@ -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
View File
@@ -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.