From 4972d6673383e0125a1db3c8ada636fe1db6639c Mon Sep 17 00:00:00 2001 From: Juliano Costa Date: Thu, 13 Oct 2022 19:22:58 +0200 Subject: [PATCH] Fix instructions and dependencies (#434) Signed-off-by: Chance Zibolski --- CHANGELOG.md | 2 ++ src/cartservice/src/Dockerfile | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94ed0f27a1..e316c4ae4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -115,3 +115,5 @@ significant modifications will be credited to OpenTelemetry Authors. ([#416](https://github.com/open-telemetry/opentelemetry-demo/pull/416)) * Replaced the Jaeger exporter to the OTLP exporter in the OTel Collector ([#435](https://github.com/open-telemetry/opentelemetry-demo/pull/435)) +* Update cartservice Dockerfile to support ARM64 +([#439](https://github.com/open-telemetry/opentelemetry-demo/pull/439)) diff --git a/src/cartservice/src/Dockerfile b/src/cartservice/src/Dockerfile index b76af3a281..e1c15eade4 100644 --- a/src/cartservice/src/Dockerfile +++ b/src/cartservice/src/Dockerfile @@ -20,13 +20,16 @@ WORKDIR /usr/src/app/ COPY ./src/cartservice/ ./ COPY ./pb/ ./src/protos/ -RUN dotnet restore ./src/cartservice.csproj -r linux-musl-x64 -RUN dotnet publish ./src/cartservice.csproj -p:PublishSingleFile=true -r linux-musl-x64 --self-contained true -p:PublishTrimmed=True -p:TrimMode=Link -c Release -o /cartservice --no-restore +RUN \ + RUNTIME_IDENTIIFER=linux-musl-x64; \ + if [ "$(uname -m)" = "aarch64" ]; then RUNTIME_IDENTIIFER=linux-musl-arm64; fi; \ + dotnet restore ./src/cartservice.csproj -r $RUNTIME_IDENTIIFER && \ + dotnet publish ./src/cartservice.csproj -p:PublishSingleFile=true -r $RUNTIME_IDENTIIFER --self-contained true -p:PublishTrimmed=True -p:TrimMode=Link -c Release -o /cartservice --no-restore # ----------------------------------------------------------------------------- # https://mcr.microsoft.com/v2/dotnet/runtime-deps/tags/list -FROM mcr.microsoft.com/dotnet/runtime-deps:6.0.5-alpine3.15-amd64 +FROM mcr.microsoft.com/dotnet/runtime-deps:6.0.5-alpine3.15 WORKDIR /usr/src/app/ COPY --from=builder /cartservice/ ./