Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Build/create-images.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Requires -Version "7.0"
#Requires -Modules @{ ModuleName="InvokeBuild"; ModuleVersion="5.14.19" }
#Requires -Modules @{ ModuleName="InvokeBuild"; ModuleVersion="5.14.23" }

Set-StrictMode -Version Latest

Expand Down
34 changes: 34 additions & 0 deletions Build/scripts/Build-DotNetImage.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
function Build-DotNetImage {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[ValidateSet('sdk', 'runtime')]
[string]
$Type,

[Parameter(Mandatory)]
[string]
$DotNetVersion,

[Parameter(Mandatory)]
[string]
$PwshVersion
)

$dockerfile = Join-Path $PSScriptRoot '../../Sources/Docker/image-dotnet.dockerfile'
$tag = "sqldatabase/dotnet_pwsh:$DotNetVersion-$Type"

exec {
docker build `
--pull `
--file $dockerfile `
--build-arg "BASE_IMAGE=mcr.microsoft.com/dotnet/$($Type):$DotNetVersion-noble-amd64" `
--build-arg "PWSH_VERSION=$PwshVersion" `
--tag $tag `
.
}

exec { docker run -it --rm $tag dotnet --list-sdks }
exec { docker run -it --rm $tag dotnet --list-runtimes }
exec { docker run -it --rm $tag pwsh --version }
}
70 changes: 9 additions & 61 deletions Build/tasks/create-images-tasks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ task . `
, BuildPgSqlDatabase `
, BuildMySqlDatabase

Get-ChildItem -Path (Join-Path $PSScriptRoot '../scripts') -Filter *.ps1 | ForEach-Object { . $_.FullName }

Enter-Build {
$context = Join-Path $PSScriptRoot '..\..\Sources\Docker'
$context = Join-Path $PSScriptRoot '../../Sources/Docker'
}

task BuildMsSqlDatabase {
Expand Down Expand Up @@ -46,68 +48,14 @@ task BuildMySqlDatabase {
}
}

task BuildDotnetSdk80 {
$dockerfile = Join-Path $context 'image-dotnet-sdk-8.0.dockerfile'
exec {
docker build `
--pull `
-f $dockerfile `
-t sqldatabase/dotnet_pwsh:8.0-sdk `
.
}
}
task BuildDotnetSdk80 { Build-DotNetImage -Type 'sdk' -DotNetVersion '8.0' -PwshVersion '7.4.15' }

task BuildDotnetRuntime80 {
$dockerfile = Join-Path $context 'image-dotnet-runtime-8.0.dockerfile'
exec {
docker build `
--pull `
-f $dockerfile `
-t sqldatabase/dotnet_pwsh:8.0-runtime `
.
}
}
task BuildDotnetRuntime80 { Build-DotNetImage -Type 'runtime' -DotNetVersion '8.0' -PwshVersion '7.4.15' }

task BuildDotnetSdk90 {
$dockerfile = Join-Path $context 'image-dotnet-sdk-9.0.dockerfile'
exec {
docker build `
--pull `
-f $dockerfile `
-t sqldatabase/dotnet_pwsh:9.0-sdk `
.
}
}
task BuildDotnetSdk90 { Build-DotNetImage -Type 'sdk' -DotNetVersion '9.0' -PwshVersion '7.5.5' }

task BuildDotnetRuntime90 {
$dockerfile = Join-Path $context 'image-dotnet-runtime-9.0.dockerfile'
exec {
docker build `
--pull `
-f $dockerfile `
-t sqldatabase/dotnet_pwsh:9.0-runtime `
.
}
}
task BuildDotnetRuntime90 { Build-DotNetImage -Type 'runtime' -DotNetVersion '9.0' -PwshVersion '7.5.5' }

task BuildDotnetSdk100 {
$dockerfile = Join-Path $context 'image-dotnet-sdk-10.0.dockerfile'
exec {
docker build `
--pull `
-f $dockerfile `
-t sqldatabase/dotnet_pwsh:10.0-sdk `
.
}
}
task BuildDotnetSdk100 { Build-DotNetImage -Type 'sdk' -DotNetVersion '10.0' -PwshVersion '7.6.1' }

task BuildDotnetRuntime100 {
$dockerfile = Join-Path $context 'image-dotnet-runtime-10.0.dockerfile'
exec {
docker build `
--pull `
-f $dockerfile `
-t sqldatabase/dotnet_pwsh:10.0-runtime `
.
}
}
task BuildDotnetRuntime100 { Build-DotNetImage -Type 'runtime' -DotNetVersion '10.0' -PwshVersion '7.6.1' }
8 changes: 0 additions & 8 deletions Sources/Docker/image-dotnet-runtime-10.0.dockerfile

This file was deleted.

8 changes: 0 additions & 8 deletions Sources/Docker/image-dotnet-runtime-8.0.dockerfile

This file was deleted.

8 changes: 0 additions & 8 deletions Sources/Docker/image-dotnet-runtime-9.0.dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions Sources/Docker/image-dotnet-sdk-10.0.dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions Sources/Docker/image-dotnet-sdk-8.0.dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions Sources/Docker/image-dotnet-sdk-9.0.dockerfile

This file was deleted.

11 changes: 11 additions & 0 deletions Sources/Docker/image-dotnet.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG BASE_IMAGE=mcr.microsoft.com/dotnet/sdk:10.0-noble-amd64
FROM ${BASE_IMAGE}

ARG PWSH_VERSION=7.6.1
RUN apt-get update && \
apt-get install --no-install-recommends -y curl && \
curl -s -L https://github.com/PowerShell/PowerShell/releases/download/v${PWSH_VERSION}/powershell_${PWSH_VERSION}-1.deb_amd64.deb --output powershell.deb && \
ls -l && \
dpkg -i powershell.deb && \
apt-get install -f && \
rm -f powershell.deb
Loading