From 82e03978b89938219958032efb1448cc76baa181 Mon Sep 17 00:00:00 2001 From: Saumit Date: Sat, 27 Sep 2025 02:14:26 +0530 Subject: Initial snapshot - OpenTelemetry demo 2.1.3 -f --- src/product-catalog/Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/product-catalog/Dockerfile (limited to 'src/product-catalog/Dockerfile') diff --git a/src/product-catalog/Dockerfile b/src/product-catalog/Dockerfile new file mode 100644 index 0000000..067a82e --- /dev/null +++ b/src/product-catalog/Dockerfile @@ -0,0 +1,27 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +FROM golang:1.24-bookworm AS builder + +WORKDIR /usr/src/app/ + +COPY ./src/product-catalog/go.mod go.mod +COPY ./src/product-catalog/go.sum go.sum + +RUN go mod download + +COPY ./src/product-catalog/genproto/oteldemo/ genproto/oteldemo/ +COPY ./src/product-catalog/products/ products/ +COPY ./src/product-catalog/main.go main.go + +RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -ldflags "-s -w" -o product-catalog main.go + +FROM gcr.io/distroless/static-debian12:nonroot + +WORKDIR /usr/src/app/ + +COPY --from=builder /usr/src/app/product-catalog/ ./ + +EXPOSE ${PRODUCT_CATALOG_PORT} +ENTRYPOINT [ "./product-catalog" ] -- cgit v1.2.3