This repository has been archived by the owner on Nov 20, 2023. It is now read-only.
define docker baseimage and tag #447
Merged
Merged
Changes from 8 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7acfd57
defin docker baseimage and tag
spboyer a19b992
add test for defined base images
spboyer 9b23e94
Merge branch 'master' into define-dockerbase
spboyer efe3c3a
fix null check warnings.
spboyer 34c0d5f
fix up
spboyer 0e6f3e7
some cleanup
spboyer 205452d
cleanup nits and suggestions
spboyer bfc7655
formatting
spboyer 9e0b5ea
null check on debug print
spboyer 781e5a5
nullorempty fix
spboyer 63606ca
ConditionalFact => Fact
jkotalik 061b0d1
Some nits to TransformProjectsIntoContainer
jkotalik 777bbaa
Update DockerContainerBuilder.cs
jkotalik c6e04ca
Inverse condition
jkotalik 960245c
bad spacing.
jkotalik File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,6 +268,15 @@ private static void EvaluateProject(OutputContext output, ProjectServiceBuilder | |
project.Frameworks.AddRange(sharedFrameworks.Select(s => new Framework(s))); | ||
output.WriteDebugLine($"Found shared frameworks: {string.Join(", ", sharedFrameworks)}"); | ||
|
||
// determine container base image | ||
if (project.ContainerInfo == null) | ||
{ | ||
project.ContainerInfo = new ContainerInfo() { UseMultiphaseDockerfile = false, }; | ||
} | ||
|
||
project.ContainerInfo!.BaseImageName = projectInstance.GetPropertyValue("ContainerBaseImage"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think having a null check here for project.ContainerInfo is probably better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need the property here, should I create it? |
||
project.ContainerInfo!.BaseImageTag = projectInstance.GetPropertyValue("ContainerBaseTag"); | ||
|
||
bool PropertyIsTrue(string property) | ||
{ | ||
return projectInstance.GetPropertyValue(property) is string s && !string.IsNullOrEmpty(s) && bool.Parse(s); | ||
|
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
17 changes: 17 additions & 0 deletions
17
test/E2ETest/testassets/projects/frontend-backend/backend/backend-baseimage.csproj
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,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<RootNamespace>Backend</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<ContainerBaseImage>mcr.microsoft.com/dotnet/core/sdk</ContainerBaseImage> | ||
<ContainerBaseTag>3.1-buster</ContainerBaseTag> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(TyeLibrariesPath)\Microsoft.Tye.Extensions.Configuration\Microsoft.Tye.Extensions.Configuration.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See @jkotalik comment : #447 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also set here https://github.com/dotnet/tye/pull/447/files#diff-b637c96b54d57dc51cd9e2aaca55198fR101
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidfowl I agree and it appears that it is the only entry point. However, @jkotalik is suggesting that there should be a null check, if it is (although it shoudn't be) we must create the instance.
previously I was just setting the values -
project.ContainerInfo!.BaseImageName