Files
magistrala/docker/Dockerfile
T
dependabot[bot] 24edbe6ad8
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
NOISSUE - Bump golang from 1.26.3-alpine3.22 to 1.26.4-alpine3.22 in /docker in the docker-dependency group (#3527)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-09 16:04:04 +02:00

32 lines
849 B
Docker

# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
FROM golang:1.26.4-alpine3.22 AS builder
ARG SVC
ARG GOARCH
ARG GOARM
ARG VERSION
ARG COMMIT
ARG TIME
ARG BUILD_TAGS
WORKDIR /go/src/github.com/absmach/magistrala
COPY . .
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.
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /exe /
ENTRYPOINT ["/exe"]