Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

.NET container-native build support #2482

stevefan1999-personal started this conversation in Ideas
Discussion options

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.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /