Skip to content

Commit

Permalink
fix: fix an issue causing container deployments to fail when run on a…
Browse files Browse the repository at this point in the history
…n ARM-based system
  • Loading branch information
philasmar committed Sep 19, 2024
1 parent da8b3eb commit f1a9ba1
Show file tree
Hide file tree
Showing 28 changed files with 137 additions and 108 deletions.
11 changes: 11 additions & 0 deletions .autover/changes/f3bdd1b8-155d-416d-b4ff-0d1bcf119e45.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Projects": [
{
"Name": "AWS.Deploy.CLI",
"Type": "Patch",
"ChangelogMessages": [
"Fix an issue causing container deployments to fail when run on an ARM-based system"
]
}
]
}
2 changes: 1 addition & 1 deletion src/AWS.Deploy.CLI/AWS.Deploy.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.5.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20574.7" />
<PackageReference Include="System.Text.Json" Version="6.0.8" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected override Task<AuthenticateResult> HandleAuthenticateAsync()
return Task.FromResult(AuthenticateResult.Fail("Missing Authorization header"));
}

return Task.FromResult(ProcessAuthorizationHeader(value, _encryptionProvider));
return Task.FromResult(ProcessAuthorizationHeader(value.ToString(), _encryptionProvider));

Check warning on line 79 in src/AWS.Deploy.CLI/ServerMode/AwsCredentialsAuthenticationHandler.cs

View check run for this annotation

Codecov / codecov/patch

src/AWS.Deploy.CLI/ServerMode/AwsCredentialsAuthenticationHandler.cs#L79

Added line #L79 was not covered by tests
}

public static AuthenticateResult ProcessAuthorizationHeader(string authorizationHeaderValue, IEncryptionProvider encryptionProvider)
Expand Down
9 changes: 5 additions & 4 deletions src/AWS.Deploy.DockerEngine/Templates/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ FROM {docker-base-image} AS base{non-root-user}
WORKDIR /app
{exposed-ports}

FROM {docker-build-image} AS build
FROM --platform=$BUILDPLATFORM {docker-build-image} AS build
ARG TARGETARCH
WORKDIR /src
{project-path-list}
RUN dotnet restore "{project-path}"
RUN dotnet restore "{project-path}" -a $TARGETARCH
COPY . .
WORKDIR "/src/{project-folder}"
RUN dotnet build "{project-name}" -c Release -o /app/build
RUN dotnet build "{project-name}" -c Release -o /app/build -a $TARGETARCH

FROM build AS publish
RUN apt-get update -yq \
Expand All @@ -18,7 +19,7 @@ RUN apt-get update -yq \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -yq \
&& apt-get install nodejs -yq
RUN dotnet publish "{project-name}" -c Release -o /app/publish
RUN dotnet publish "{project-name}" -c Release -o /app/publish -a $TARGETARCH

FROM base AS final{http-port-env-variable}
WORKDIR /app
Expand Down
7 changes: 2 additions & 5 deletions src/AWS.Deploy.Orchestration/AWS.Deploy.Orchestration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
<RootNamespace>AWS.Deploy.Orchestration</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\AWS.Deploy.Recipes.CDK.Common\RecipeProps.cs" Link="RecipeProps.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.CloudControlApi" Version="3.7.300.77" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.302.18" />
Expand All @@ -31,14 +27,15 @@
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageReference Include="Microsoft.TemplateEngine.IDE" Version="5.0.1" />
<PackageReference Include="Microsoft.TemplateEngine.Orchestrator.RunnableProjects" Version="5.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="YamlDotNet" Version="13.4.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AWS.Deploy.Recipes\AWS.Deploy.Recipes.csproj" />
<ProjectReference Include="..\AWS.Deploy.DockerEngine\AWS.Deploy.DockerEngine.csproj" />
<ProjectReference Include="..\AWS.Deploy.Recipes.CDK.Common\AWS.Deploy.Recipes.CDK.Common.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/AWS.Deploy.Orchestration/DeploymentBundleHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public async Task BuildDockerImage(CloudApplication cloudApplication, Recommenda
var buildArgs = GetDockerBuildArgs(recommendation);
DockerUtilities.TryGetAbsoluteDockerfile(recommendation, _fileManager, _directoryManager, out var dockerFile);

var dockerBuildCommand = $"docker build -t {imageTag} -f \"{dockerFile}\"{buildArgs} .";
var dockerBuildCommand = $"docker build --platform linux/amd64 -t {imageTag} -f \"{dockerFile}\"{buildArgs} .";
_interactiveService.LogInfoMessage($"Docker Execution Directory: {Path.GetFullPath(dockerExecutionDirectory)}");
_interactiveService.LogInfoMessage($"Docker Build Command: {dockerBuildCommand}");

Expand Down
4 changes: 2 additions & 2 deletions src/AWS.Deploy.Orchestration/TemplateEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void GenerateCDKProjectFromTemplate(Recommendation recommendation, Orches
{
throw new InvalidOperationException($"{nameof(recommendation.Recipe.CdkProjectTemplateId)} cannot be null or an empty string");
}

//The location of the base template that will be installed into the templating engine
var cdkProjectTemplateDirectory = Path.Combine(
Path.GetDirectoryName(recommendation.Recipe.RecipePath) ??
Expand All @@ -67,7 +67,7 @@ public void GenerateCDKProjectFromTemplate(Recommendation recommendation, Orches
var templateParameters = new Dictionary<string, string> {
// CDK Template projects can parameterize the version number of the AWS.Deploy.Recipes.CDK.Common package. This avoid
// projects having to be modified every time the package version is bumped.
{ "AWSDeployRecipesCDKCommonVersion", FileVersionInfo.GetVersionInfo(typeof(Constants.CloudFormationIdentifier).Assembly.Location).ProductVersion
{ "AWSDeployRecipesCDKCommonVersion", FileVersionInfo.GetVersionInfo(typeof(AWS.Deploy.Recipes.CDK.Common.CDKRecipeSetup).Assembly.Location).ProductVersion

Check warning on line 70 in src/AWS.Deploy.Orchestration/TemplateEngine.cs

View check run for this annotation

Codecov / codecov/patch

src/AWS.Deploy.Orchestration/TemplateEngine.cs#L70

Added line #L70 was not covered by tests
?? throw new InvalidAWSDeployRecipesCDKCommonVersionException(DeployToolErrorCode.InvalidAWSDeployRecipesCDKCommonVersion, "The version number of the AWS.Deploy.Recipes.CDK.Common package is invalid.") }
};

Expand Down
6 changes: 3 additions & 3 deletions test/AWS.Deploy.CLI.UnitTests/DeploymentBundleHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public async Task BuildDockerImage_DockerExecutionDirectoryNotSet()
var expectedDockerFile = Path.GetFullPath(Path.Combine(".", "Dockerfile"), recommendation.GetProjectDirectory());
var dockerExecutionDirectory = Directory.GetParent(Path.GetFullPath(recommendation.ProjectPath)).Parent.Parent;

Assert.Equal($"docker build -t {imageTag} -f \"{expectedDockerFile}\" .",
Assert.Equal($"docker build --platform linux/amd64 -t {imageTag} -f \"{expectedDockerFile}\" .",
_commandLineWrapper.CommandsToExecute.First().Command);
Assert.Equal(dockerExecutionDirectory.FullName,
_commandLineWrapper.CommandsToExecute.First().WorkingDirectory);
Expand All @@ -116,7 +116,7 @@ public async Task BuildDockerImage_DockerExecutionDirectorySet()

var expectedDockerFile = Path.GetFullPath(Path.Combine(".", "Dockerfile"), recommendation.GetProjectDirectory());

Assert.Equal($"docker build -t {imageTag} -f \"{expectedDockerFile}\" .",
Assert.Equal($"docker build --platform linux/amd64 -t {imageTag} -f \"{expectedDockerFile}\" .",
_commandLineWrapper.CommandsToExecute.First().Command);
Assert.Equal(projectPath,
_commandLineWrapper.CommandsToExecute.First().WorkingDirectory);
Expand Down Expand Up @@ -145,7 +145,7 @@ public async Task BuildDockerImage_AlternativeDockerfilePathSet()
var imageTag = "imageTag";
await _deploymentBundleHandler.BuildDockerImage(cloudApplication, recommendation, imageTag);

Assert.Equal($"docker build -t {imageTag} -f \"{dockerfilePath}\" .",
Assert.Equal($"docker build --platform linux/amd64 -t {imageTag} -f \"{dockerfilePath}\" .",
_commandLineWrapper.CommandsToExecute.First().Command);
Assert.Equal(expectedDockerExecutionDirectory.FullName,
_commandLineWrapper.CommandsToExecute.First().WorkingDirectory);
Expand Down
11 changes: 6 additions & 5 deletions testapps/docker/ConsoleSdkType/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY ["ConsoleSdkType.csproj", ""]
RUN dotnet restore "ConsoleSdkType.csproj"
RUN dotnet restore "ConsoleSdkType.csproj" -a $TARGETARCH
COPY . .
WORKDIR "/src/"
RUN dotnet build "ConsoleSdkType.csproj" -c Release -o /app/build
RUN dotnet build "ConsoleSdkType.csproj" -c Release -o /app/build -a $TARGETARCH

FROM build AS publish
RUN apt-get update -yq \
Expand All @@ -19,7 +20,7 @@ RUN apt-get update -yq \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -yq \
&& apt-get install nodejs -yq
RUN dotnet publish "ConsoleSdkType.csproj" -c Release -o /app/publish
RUN dotnet publish "ConsoleSdkType.csproj" -c Release -o /app/publish -a $TARGETARCH

FROM base AS final
WORKDIR /app
Expand Down
9 changes: 5 additions & 4 deletions testapps/docker/ConsoleSdkType/ReferenceDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY ["ConsoleSdkType.csproj", ""]
RUN dotnet restore "ConsoleSdkType.csproj"
RUN dotnet restore "ConsoleSdkType.csproj" -a $TARGETARCH
COPY . .
WORKDIR "/src/"
RUN dotnet build "ConsoleSdkType.csproj" -c Release -o /app/build
RUN dotnet build "ConsoleSdkType.csproj" -c Release -o /app/build -a $TARGETARCH

FROM build AS publish
RUN apt-get update -yq \
Expand All @@ -19,7 +20,7 @@ RUN apt-get update -yq \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -yq \
&& apt-get install nodejs -yq
RUN dotnet publish "ConsoleSdkType.csproj" -c Release -o /app/publish
RUN dotnet publish "ConsoleSdkType.csproj" -c Release -o /app/publish -a $TARGETARCH

FROM base AS final
WORKDIR /app
Expand Down
11 changes: 6 additions & 5 deletions testapps/docker/WebAppDifferentAssemblyName/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY ["WebAppDifferentAssemblyName.csproj", ""]
RUN dotnet restore "WebAppDifferentAssemblyName.csproj"
RUN dotnet restore "WebAppDifferentAssemblyName.csproj" -a $TARGETARCH
COPY . .
WORKDIR "/src/"
RUN dotnet build "WebAppDifferentAssemblyName.csproj" -c Release -o /app/build
RUN dotnet build "WebAppDifferentAssemblyName.csproj" -c Release -o /app/build -a $TARGETARCH

FROM build AS publish
RUN apt-get update -yq \
Expand All @@ -19,7 +20,7 @@ RUN apt-get update -yq \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -yq \
&& apt-get install nodejs -yq
RUN dotnet publish "WebAppDifferentAssemblyName.csproj" -c Release -o /app/publish
RUN dotnet publish "WebAppDifferentAssemblyName.csproj" -c Release -o /app/publish -a $TARGETARCH

FROM base AS final
WORKDIR /app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY ["WebAppDifferentAssemblyName.csproj", ""]
RUN dotnet restore "WebAppDifferentAssemblyName.csproj"
RUN dotnet restore "WebAppDifferentAssemblyName.csproj" -a $TARGETARCH
COPY . .
WORKDIR "/src/"
RUN dotnet build "WebAppDifferentAssemblyName.csproj" -c Release -o /app/build
RUN dotnet build "WebAppDifferentAssemblyName.csproj" -c Release -o /app/build -a $TARGETARCH

FROM build AS publish
RUN apt-get update -yq \
Expand All @@ -19,7 +20,7 @@ RUN apt-get update -yq \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -yq \
&& apt-get install nodejs -yq
RUN dotnet publish "WebAppDifferentAssemblyName.csproj" -c Release -o /app/publish
RUN dotnet publish "WebAppDifferentAssemblyName.csproj" -c Release -o /app/publish -a $TARGETARCH

FROM base AS final
WORKDIR /app
Expand Down
11 changes: 6 additions & 5 deletions testapps/docker/WebAppDifferentTargetFramework/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY ["WebAppDifferentTargetFramework.csproj", ""]
RUN dotnet restore "WebAppDifferentTargetFramework.csproj"
RUN dotnet restore "WebAppDifferentTargetFramework.csproj" -a $TARGETARCH
COPY . .
WORKDIR "/src/"
RUN dotnet build "WebAppDifferentTargetFramework.csproj" -c Release -o /app/build
RUN dotnet build "WebAppDifferentTargetFramework.csproj" -c Release -o /app/build -a $TARGETARCH

FROM build AS publish
RUN apt-get update -yq \
Expand All @@ -19,7 +20,7 @@ RUN apt-get update -yq \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -yq \
&& apt-get install nodejs -yq
RUN dotnet publish "WebAppDifferentTargetFramework.csproj" -c Release -o /app/publish
RUN dotnet publish "WebAppDifferentTargetFramework.csproj" -c Release -o /app/publish -a $TARGETARCH

FROM base AS final
WORKDIR /app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY ["WebAppDifferentTargetFramework.csproj", ""]
RUN dotnet restore "WebAppDifferentTargetFramework.csproj"
RUN dotnet restore "WebAppDifferentTargetFramework.csproj" -a $TARGETARCH
COPY . .
WORKDIR "/src/"
RUN dotnet build "WebAppDifferentTargetFramework.csproj" -c Release -o /app/build
RUN dotnet build "WebAppDifferentTargetFramework.csproj" -c Release -o /app/build -a $TARGETARCH

FROM build AS publish
RUN apt-get update -yq \
Expand All @@ -19,7 +20,7 @@ RUN apt-get update -yq \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -yq \
&& apt-get install nodejs -yq
RUN dotnet publish "WebAppDifferentTargetFramework.csproj" -c Release -o /app/publish
RUN dotnet publish "WebAppDifferentTargetFramework.csproj" -c Release -o /app/publish -a $TARGETARCH

FROM base AS final
WORKDIR /app
Expand Down
11 changes: 6 additions & 5 deletions testapps/docker/WebAppNet7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY ["WebAppNet7.csproj", ""]
RUN dotnet restore "WebAppNet7.csproj"
RUN dotnet restore "WebAppNet7.csproj" -a $TARGETARCH
COPY . .
WORKDIR "/src/"
RUN dotnet build "WebAppNet7.csproj" -c Release -o /app/build
RUN dotnet build "WebAppNet7.csproj" -c Release -o /app/build -a $TARGETARCH

FROM build AS publish
RUN apt-get update -yq \
Expand All @@ -19,7 +20,7 @@ RUN apt-get update -yq \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -yq \
&& apt-get install nodejs -yq
RUN dotnet publish "WebAppNet7.csproj" -c Release -o /app/publish
RUN dotnet publish "WebAppNet7.csproj" -c Release -o /app/publish -a $TARGETARCH

FROM base AS final
WORKDIR /app
Expand Down
9 changes: 5 additions & 4 deletions testapps/docker/WebAppNet7/ReferenceDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY ["WebAppNet7.csproj", ""]
RUN dotnet restore "WebAppNet7.csproj"
RUN dotnet restore "WebAppNet7.csproj" -a $TARGETARCH
COPY . .
WORKDIR "/src/"
RUN dotnet build "WebAppNet7.csproj" -c Release -o /app/build
RUN dotnet build "WebAppNet7.csproj" -c Release -o /app/build -a $TARGETARCH

FROM build AS publish
RUN apt-get update -yq \
Expand All @@ -19,7 +20,7 @@ RUN apt-get update -yq \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -yq \
&& apt-get install nodejs -yq
RUN dotnet publish "WebAppNet7.csproj" -c Release -o /app/publish
RUN dotnet publish "WebAppNet7.csproj" -c Release -o /app/publish -a $TARGETARCH

FROM base AS final
WORKDIR /app
Expand Down
13 changes: 7 additions & 6 deletions testapps/docker/WebAppNet8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY ["WebAppNet8.csproj", ""]
RUN dotnet restore "WebAppNet8.csproj"
RUN dotnet restore "WebAppNet8.csproj" -a $TARGETARCH
COPY . .
WORKDIR "/src/"
RUN dotnet build "WebAppNet8.csproj" -c Release -o /app/build
RUN dotnet build "WebAppNet8.csproj" -c Release -o /app/build -a $TARGETARCH

FROM build AS publish
RUN apt-get update -yq \
Expand All @@ -20,7 +21,7 @@ RUN apt-get update -yq \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -yq \
&& apt-get install nodejs -yq
RUN dotnet publish "WebAppNet8.csproj" -c Release -o /app/publish
RUN dotnet publish "WebAppNet8.csproj" -c Release -o /app/publish -a $TARGETARCH

FROM base AS final
WORKDIR /app
Expand Down
Loading

0 comments on commit f1a9ba1

Please sign in to comment.