Skip to content

Commit 041d0a2

Browse files
committed
(build) small changes to the DockerBuild target
1 parent 68f45cc commit 041d0a2

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ releaseArtifacts
117117
.dotnet
118118
artifacts
119119
!build/artifacts
120-
build/docker/content
120+
build/docker/nuget
121121
src/PublicAPI.empty.txt
122122

123123
!**/*.cake

build/CI.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ProjectSection(SolutionItems) = preProject
55
Directory.Packages.props = Directory.Packages.props
66
..\dotnet-tools.json = ..\dotnet-tools.json
77
..\global.json = ..\global.json
8+
..\.gitignore = ..\.gitignore
89
EndProjectSection
910
EndProject
1011
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "build", "build\build.csproj", "{1AC00FB2-E28A-46B7-9683-AA7A1AFC29EB}"

build/common/Utilities/DockerContextExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public static void DockerBuildImage(this BuildContextBase context, DockerImage d
4949
var tags = context.GetDockerTags(dockerImage, arch);
5050

5151
var suffix = arch.ToSuffix();
52-
var imageSuffix = $"({distro}-{context.Version.NugetVersion}-{targetFramework}-{arch.ToSuffix()})";
53-
var baseNameSuffix = $"{registry}/{Constants.DockerBaseImageName}:{distro}-runtime-{targetFramework}-{arch.ToSuffix()}";
52+
var imageSuffix = $"({distro}-{context.Version.NugetVersion}-{targetFramework}-{suffix})";
53+
var baseNameSuffix = $"{registry}/{Constants.DockerBaseImageName}:{distro}-runtime-{targetFramework}-{suffix}";
5454
var description = $"org.opencontainers.image.description=GitVersion images {imageSuffix}";
5555
var baseName = $"org.opencontainers.image.base.name={baseNameSuffix}";
5656
var version = $"org.opencontainers.image.version={context.Version.NugetVersion}";
@@ -68,7 +68,7 @@ public static void DockerBuildImage(this BuildContextBase context, DockerImage d
6868
File = workDir.CombineWithFilePath("Dockerfile").FullPath,
6969
BuildArg =
7070
[
71-
"contentFolder=/content",
71+
"nugetFolder=/nuget",
7272
$"REGISTRY={registry}",
7373
$"DOTNET_VERSION={targetFramework}",
7474
$"DISTRO={distro}",

build/docker/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
ARG REGISTRY='docker.io'
2-
ARG DISTRO='debian-11'
2+
ARG DISTRO='debian.11'
33
ARG DOTNET_VERSION='6.0'
44
ARG VERSION='5.12.0'
55

66
FROM $REGISTRY/gittools/build-images:$DISTRO-sdk-$DOTNET_VERSION as installer
7-
ARG contentFolder
7+
ARG nugetFolder
88
ARG VERSION
99

10-
WORKDIR /app
11-
COPY $contentFolder/ ./
10+
WORKDIR /nuget
11+
COPY $nugetFolder/ ./
1212
RUN dotnet tool install GitVersion.Tool --version $VERSION --tool-path /tools --add-source .
1313

1414
FROM $REGISTRY/gittools/build-images:$DISTRO-runtime-$DOTNET_VERSION

build/docker/Tasks/DockerBuild.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public override bool ShouldRun(BuildContext context)
2121
public override void Run(BuildContext context)
2222
{
2323
var tool = Paths.Nuget.CombineWithFilePath("GitVersion.Tool*");
24-
var dest = Paths.Build.Combine("docker").Combine("content");
24+
var dest = Paths.Build.Combine("docker").Combine("nuget");
2525
context.EnsureDirectoryExists(dest);
2626
context.CopyFiles(tool.FullPath, dest);
2727

0 commit comments

Comments
 (0)