-
Notifications
You must be signed in to change notification settings - Fork 392
.NET container-native build support #2482
stevefan1999-personal
started this conversation in
Ideas
-
Starting from .NET 7, you can build image directly into OCI images like Jib and kanico by installing a simple Microsoft.NET.Build.Containers
package.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.11.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Build.Containers" Version="0.2.7" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
</ItemGroup>
<ItemGroup>
<ContainerPort Include="5000" Type="tcp" />
<ContainerPort Include="5001" Type="tcp" />
<ContainerPort Include="5153" Type="tcp" />
<ContainerPort Include="7023" Type="tcp" />
<ContainerPort Include="80" Type="tcp" />
<ContainerPort Include="443" Type="tcp" />
</ItemGroup>
<Target Name="BeforePublishContainer" BeforeTargets="ComputeContainerConfig" DependsOnTargets="RunGitVersion">
<PropertyGroup>
<ContainerImageTag>$(GitVersion_ShortSha)</ContainerImageTag>
</PropertyGroup>
</Target>
</Project>
We should support this use case in devspace, and even exploit some existing metadata to speed up development experience for dotnet hackers.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment