Skip to content

Commit

Permalink
Remove https port variables
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussell authored Feb 7, 2023
1 parent a60cc4f commit bd831bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
5 changes: 2 additions & 3 deletions eng/dockerfile-templates/Dockerfile.common-dotnet-envs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
set isDistroless to find(OS_VERSION, "distroless") >= 0 || find(OS_VERSION, "chiseled") >= 0 ^
set lineContinuation to when(isWindows, "`", "\") ^
set port to when(isDistroless, "8080", "80") ^
set httpPort to "8080" ^
set httpsPort to "8443"
set httpPort to "8080"
}}ENV {{lineContinuation}}
{{if dotnetVersion != "8.0":# Configure web servers to bind to port {{port}} when present
ASPNETCORE_URLS=http://+:{{port}} {{lineContinuation}}^else:# Configure web servers to bind to port {{httpPort}}/{{httpsPort}} when present
ASPNETCORE_URLS=http://+:{{port}} {{lineContinuation}}^else:# Configure web servers to bind to port {{httpPort}} when present
ASPNETCORE_HTTP_PORTS={{httpPort}} {{lineContinuation}}}}
{{InsertTemplate("Dockerfile.env.container")}}{{if isAlpine || (isDistroless && !(isMariner && find(OS_VERSION, "1.0") > 0)): {{lineContinuation}}
# Set the invariant mode since ICU package isn't included (see https://github.com/dotnet/announcements/issues/20)
Expand Down
6 changes: 1 addition & 5 deletions tests/Microsoft.DotNet.Docker.Tests/ImageData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public abstract class ImageData
public bool IsArm => Arch == Arch.Arm || Arch == Arch.Arm64;
public string OS { get; set; }
public bool IsDistroless => OS.Contains("distroless") || OS.Contains("chiseled");
// public int DefaultPort { get; }
// public int DefaultHTTPSPort { get; }
public virtual int DefaultPort => IsDistroless ? 8080 : 80;

private static readonly Lazy<JObject> s_imageInfoData;

Expand Down Expand Up @@ -68,9 +67,6 @@ public string Platform

public bool IsWindows => OS.StartsWith(Tests.OS.NanoServer) || OS.StartsWith(Tests.OS.ServerCore);

public virtual int DefaultPort => IsDistroless ? 8080 : 80;
public virtual int DefaultHTTPSPort => 443;

public string Rid
{
get
Expand Down
5 changes: 0 additions & 5 deletions tests/Microsoft.DotNet.Docker.Tests/ProductImageData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ public override int DefaultPort
get => (IsDistroless | Version.Major >= 8) ? 8080 : 80;
}

public override int DefaultHTTPSPort
{
get => (IsDistroless | Version.Major >= 8) ? 8443 : 443;
}

public string GetDockerfilePath(DotNetImageType imageType) =>
$"src/{GetVariantName(imageType)}/{Version}/{OSTag}/{GetArchLabel()}";

Expand Down

0 comments on commit bd831bf

Please sign in to comment.