Skip to content

Commit

Permalink
[cartservice] Update to .NET 7 (#942)
Browse files Browse the repository at this point in the history
* [cartservice] Update to .NET 7

* Add changelog entry

* Avoid trimming application due
open-telemetry/opentelemetry-dotnet#4600
  • Loading branch information
Kielek authored Jun 21, 2023
1 parent 985e18b commit 846ae2d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ release.
([#914](https://github.com/open-telemetry/opentelemetry-demo/pull/914))
* [cartservice] update .NET package to 1.5.0 release
([#935](https://github.com/open-telemetry/opentelemetry-demo/pull/935))
* [cartservice] update service to .NET 7
([#942](https://github.com/open-telemetry/opentelemetry-demo/pull/942))

## 1.4.0

Expand Down
6 changes: 3 additions & 3 deletions src/cartservice/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

# https://mcr.microsoft.com/v2/dotnet/sdk/tags/list
FROM mcr.microsoft.com/dotnet/sdk:6.0.408 AS builder
FROM mcr.microsoft.com/dotnet/sdk:7.0.304 AS builder

WORKDIR /usr/src/app/

Expand All @@ -26,12 +26,12 @@ 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
dotnet publish ./src/cartservice.csproj -p:PublishSingleFile=true -r $RUNTIME_IDENTIIFER --self-contained true -p:PublishTrimmed=False -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.16-alpine3.17
FROM mcr.microsoft.com/dotnet/runtime-deps:7.0.7-alpine3.17

WORKDIR /usr/src/app/
COPY --from=builder /cartservice/ ./
Expand Down
2 changes: 1 addition & 1 deletion src/cartservice/src/cartservice.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/cartservice/tests/cartservice.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Net.Client" Version="2.53.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.16" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
Expand Down

0 comments on commit 846ae2d

Please sign in to comment.