forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] add multi platform build support (open-telemetry#1785)
* multiplatform build * multiplatform build instructions * fix tests * multi-platform build support * fix failed linting * stop tests properly * fix grammar * fix multi-platform builds * align with cartservice steps * remove buildx warnings * add create-multiplatform-builder target * support Linux to create multiplaform builder * update multiplatform build instructions * add multiplatform build support * add multiplatform build support * add multiplatform build support * create and remove multi-platform builder * clarify multi-platform build instructions * clarify multi-platform build instructions * use shell directly for env var subst * Update CONTRIBUTING.md --------- Co-authored-by: Juliano Costa <[email protected]>
- Loading branch information
1 parent
5c748f7
commit 8a86840
Showing
16 changed files
with
137 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
[worker.oci] | ||
max-parallelism = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,25 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||
USER app | ||
WORKDIR /app | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["/src/accountingservice/", "AccountingService/"] | ||
COPY ["/pb/demo.proto", "AccountingService/proto/"] | ||
RUN dotnet restore "./AccountingService/AccountingService.csproj" | ||
WORKDIR "/src/AccountingService" | ||
|
||
RUN dotnet build "./AccountingService.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "./AccountingService.csproj" --use-current-runtime -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
|
||
USER root | ||
RUN mkdir -p "/var/log/opentelemetry/dotnet" | ||
RUN chown app "/var/log/opentelemetry/dotnet" | ||
RUN chown app "/app/instrument.sh" | ||
USER app | ||
FROM --platform=${BUILDPLATFORM} mcr.microsoft.com/dotnet/sdk:8.0 AS builder | ||
ARG TARGETARCH | ||
|
||
WORKDIR /usr/src/app/ | ||
|
||
COPY ./src/accountingservice/ ./ | ||
COPY ./pb/ ./proto/ | ||
|
||
RUN dotnet restore "./AccountingService.csproj" -r linux-musl-$TARGETARCH | ||
|
||
RUN dotnet publish "./AccountingService.csproj" -r linux-musl-$TARGETARCH --no-restore -o /accountingservice | ||
|
||
# ----------------------------------------------------------------------------- | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 | ||
|
||
WORKDIR /usr/src/app/ | ||
COPY --from=builder /accountingservice/ ./ | ||
|
||
ENV DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE=false | ||
|
||
ENTRYPOINT ["./instrument.sh", "dotnet", "AccountingService.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.