diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a9b67fd7b..02e80aa9fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -118,3 +118,5 @@ significant modifications will be credited to OpenTelemetry Authors. [#432](https://github.com/open-telemetry/opentelemetry-demo/pull/432) * 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/ ./