Files
query-orchestration/build/Dockerfile
T

31 lines
573 B
Docker
Raw Normal View History

2024-12-19 11:38:57 +00:00
# syntax=docker/dockerfile:1
2025-03-06 22:33:39 +00:00
ARG GO_VERSION=1.24.0
2025-01-10 12:58:14 +00:00
2024-12-19 11:38:57 +00:00
FROM golang:${GO_VERSION} AS build
2025-01-10 12:58:14 +00:00
WORKDIR /app
2024-12-19 11:38:57 +00:00
2025-03-06 22:33:39 +00:00
# Install Git if not already present
RUN apt-get update && apt-get install -y --no-install-recommends git=1:2.* && apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy the entire repository including .git directory
COPY . .
2024-12-19 11:38:57 +00:00
ARG TARGETARCH
SHELL ["/bin/bash", "-c"]
2024-12-19 11:38:57 +00:00
RUN --mount=type=cache,target=/go/pkg/mod/ \
CGO_ENABLED=0 GOARCH=$TARGETARCH go build -o /bin ./cmd/...
2024-12-19 11:38:57 +00:00
2025-01-10 11:12:03 +00:00
FROM scratch AS final
2024-12-19 11:38:57 +00:00
ENV PWD=/app
WORKDIR ${PWD}
2025-01-10 12:58:14 +00:00
COPY --from=build /bin/ .
EXPOSE 8080