Skip to content

Commit

Permalink
Update docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
peters committed Dec 9, 2020
1 parent da06c8f commit af0d3f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
7 changes: 1 addition & 6 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ param(
[Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
[string] $DockerImageName = "snapx",
[Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)]
[string] $DockerVersion = "3.0.100",
[string] $DockerVersion = "3.0.101",
[Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)]
[switch] $DockerLocal,
[Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
Expand Down Expand Up @@ -70,7 +70,6 @@ switch -regex ($OSVersion) {

$DockerFilenamePath = Join-Path $WorkingDir docker\Dockerfile
$DockerGithubRegistryUrl = "docker.pkg.github.com/fintermobilityas/snapx"
$DockerContainerUrl = "mcr.microsoft.com/dotnet/sdk:5.0.100-rc.1-focal"
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False

$SummaryStopwatch = $Stopwatch::StartNew()
Expand Down Expand Up @@ -512,10 +511,6 @@ switch ($Target) {
}
}
"Publish-Docker-Image" {
$DockerFileContent = Get-Content $DockerFilenamePath
$DockerFileContent[0] = "FROM $DockerContainerUrl as env-build"
$DockerFileContent | Out-File $DockerFilenamePath -Encoding $Utf8NoBomEncoding

Invoke-Command-Colored $CommandDocker @(
"build -f ""$DockerFilenamePath"" -t ${DockerGithubRegistryUrl}/${DockerImageName}:${DockerVersion} docker"
)
Expand Down
14 changes: 11 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0.100-rc.1-focal as env-build
FROM ubuntu:20.04 as env-build

ENV DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -35,14 +35,22 @@ RUN \
RUN \
apt-get update && \
apt-get install -y --no-install-recommends \
cmake:amd64 make:amd64 gcc-8:amd64 g++-8:amd64 uuid-dev:amd64 lsb-core:amd64 curl:amd64 && \
cmake:amd64 make:amd64 gcc-8:amd64 g++-8:amd64 uuid-dev:amd64 lsb-core:amd64 curl:amd64 wget:amd64 && \
rm -rf /var/lib/apt/lists/*

RUN \
apt-get update && \
apt-get install -y apt-transport-https:amd64 ca-certificates:amd64 && \
wget --no-check-certificate https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
apt-get update && \
apt-get install -y dotnet-sdk-5.0:amd64 && \
dotnet tool update powershell -g

RUN \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8

FROM env-build as env-run
RUN mkdir /root/.dotnet/tools
ENV PATH="/root/.dotnet/tools:${PATH}"
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
CMD ["sh", "-c", "(cd $SNAPX_DOCKER_WORKING_DIR && pwsh ./build.ps1 $BUILD_PS_PARAMETERS)"]

0 comments on commit af0d3f3

Please sign in to comment.