Files
query-orchestration/build/Dockerfile
T
Michael McGuinness c4c0b9bd32 Merged in update/ci (pull request #127)
added CI

* onlywherenecessary

* export

* dockersocketoverride

* disablecleanup

* networkfromenv

* fullsuite

* ci

* dockerhost

* name

* network

* buildfirst

* rm

* caches

* additionalcaches

* additionalcaches

* cachenix

* nix

* requiredprofile

* nonixcache

* nobuild

* moremem

* rmgomodules

* buildfirst

* faster

* clean
2025-05-08 16:04:45 +00:00

49 lines
806 B
Docker

# syntax=docker/dockerfile:1
ARG GO_VERSION=1.24.0
FROM golang:${GO_VERSION} AS build
WORKDIR /app
RUN apt-get update && \
apt-get install -y --no-install-recommends git=1:2.* musl-tools=1.2.* && \
apt-get clean && \
rm -rf /var/lib/apt-get/lists/*
COPY go.mod .
COPY go.sum .
COPY vendor/ vendor/
RUN go mod verify
COPY cmd/ cmd/
COPY api/ api/
COPY internal/ internal/
COPY --link .git/ .git/
ARG TARGETARCH
ENV CGO_ENABLED=1
ENV GOARCH=${TARGETARCH}
ENV CC=musl-gcc
RUN mkdir bin/ && \
go build \
-mod vendor \
-tags musl \
-ldflags "-linkmode external -extldflags -static" \
-o bin/ ./cmd/...
FROM scratch AS final
ENV PWD=/app
WORKDIR ${PWD}
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /app/bin/ .
EXPOSE 8080