From 8bc89309596d1eb06340520578b5a7044dbd6a23 Mon Sep 17 00:00:00 2001 From: Bryce Milton - MSFT Date: Tue, 8 Nov 2016 14:41:58 -0800 Subject: [PATCH] Refactoring Linux Nighly Dockerfiles to in-line Bootstrap.ps1 code Provides simpler usability by making the dockerfiles self-contained. --- docker/nightly/bootstrap.ps1 | 8 -------- docker/nightly/centos7/Dockerfile | 14 +++++++++++--- docker/nightly/centos7/bootstrap.ps1 | 8 -------- docker/nightly/ubuntu14.04/Dockerfile | 14 +++++++++++--- docker/nightly/ubuntu14.04/bootstrap.ps1 | 8 -------- docker/nightly/ubuntu16.04/Dockerfile | 14 +++++++++++--- docker/nightly/ubuntu16.04/bootstrap.ps1 | 8 -------- docker/release/nanoserver/Dockerfile | 5 +---- docker/release/windowsservercore/Dockerfile | 5 +---- 9 files changed, 35 insertions(+), 49 deletions(-) delete mode 100644 docker/nightly/bootstrap.ps1 delete mode 100644 docker/nightly/centos7/bootstrap.ps1 delete mode 100644 docker/nightly/ubuntu14.04/bootstrap.ps1 delete mode 100644 docker/nightly/ubuntu16.04/bootstrap.ps1 diff --git a/docker/nightly/bootstrap.ps1 b/docker/nightly/bootstrap.ps1 deleted file mode 100644 index d48c9468d3..0000000000 --- a/docker/nightly/bootstrap.ps1 +++ /dev/null @@ -1,8 +0,0 @@ -# This is intended to be used inside Docker containers - -git clone --recursive https://github.com/$env:fork/PowerShell.git -b $env:branch -Set-Location PowerShell -Import-Module ./build.psm1 -Start-PSBootstrap -Package -NoSudo -Start-PSBuild -Crossgen -Start-PSPackage diff --git a/docker/nightly/centos7/Dockerfile b/docker/nightly/centos7/Dockerfile index cacbf44d2b..40067edd5b 100644 --- a/docker/nightly/centos7/Dockerfile +++ b/docker/nightly/centos7/Dockerfile @@ -1,9 +1,17 @@ FROM microsoft/powershell:centos7 MAINTAINER Andrew Schwartzmeyer +LABEL Readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" +LABEL Description="This Dockerfile will install and build the latest release of PS." ARG fork=PowerShell ARG branch=master +SHELL ["powershell", "-command"] +RUN git clone --recursive https://github.com/$env:fork/PowerShell.git -b $env:branch; \ + Set-Location PowerShell; \ + Import-Module ./build.psm1; \ + Start-PSBootstrap -Package -NoSudo; \ + Start-PSBuild -Crossgen; \ + Start-PSPackage; -COPY bootstrap.ps1 / -RUN powershell -f bootstrap.ps1 \ - && yum install -y PowerShell/powershell*.rpm +SHELL ["/bin/sh", "-c"] +RUN yum install -y PowerShell/powershell*.rpm \ No newline at end of file diff --git a/docker/nightly/centos7/bootstrap.ps1 b/docker/nightly/centos7/bootstrap.ps1 deleted file mode 100644 index d48c9468d3..0000000000 --- a/docker/nightly/centos7/bootstrap.ps1 +++ /dev/null @@ -1,8 +0,0 @@ -# This is intended to be used inside Docker containers - -git clone --recursive https://github.com/$env:fork/PowerShell.git -b $env:branch -Set-Location PowerShell -Import-Module ./build.psm1 -Start-PSBootstrap -Package -NoSudo -Start-PSBuild -Crossgen -Start-PSPackage diff --git a/docker/nightly/ubuntu14.04/Dockerfile b/docker/nightly/ubuntu14.04/Dockerfile index 7b529946e0..17db77b19f 100644 --- a/docker/nightly/ubuntu14.04/Dockerfile +++ b/docker/nightly/ubuntu14.04/Dockerfile @@ -1,9 +1,17 @@ FROM microsoft/powershell:ubuntu14.04 MAINTAINER Andrew Schwartzmeyer +LABEL Readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" +LABEL Description="This Dockerfile will install and build the latest release of PS." ARG fork=PowerShell ARG branch=master +SHELL ["powershell", "-command"] +RUN git clone --recursive https://github.com/$env:fork/PowerShell.git -b $env:branch; \ + Set-Location PowerShell; \ + Import-Module ./build.psm1; \ + Start-PSBootstrap -Package -NoSudo; \ + Start-PSBuild -Crossgen; \ + Start-PSPackage; -COPY bootstrap.ps1 / -RUN powershell -f bootstrap.ps1 \ - && dpkg -i PowerShell/powershell*.deb +SHELL ["/bin/sh", "-c"] +RUN dpkg -i PowerShell/powershell*.deb diff --git a/docker/nightly/ubuntu14.04/bootstrap.ps1 b/docker/nightly/ubuntu14.04/bootstrap.ps1 deleted file mode 100644 index d48c9468d3..0000000000 --- a/docker/nightly/ubuntu14.04/bootstrap.ps1 +++ /dev/null @@ -1,8 +0,0 @@ -# This is intended to be used inside Docker containers - -git clone --recursive https://github.com/$env:fork/PowerShell.git -b $env:branch -Set-Location PowerShell -Import-Module ./build.psm1 -Start-PSBootstrap -Package -NoSudo -Start-PSBuild -Crossgen -Start-PSPackage diff --git a/docker/nightly/ubuntu16.04/Dockerfile b/docker/nightly/ubuntu16.04/Dockerfile index f7fc6248e1..bfcee5240c 100644 --- a/docker/nightly/ubuntu16.04/Dockerfile +++ b/docker/nightly/ubuntu16.04/Dockerfile @@ -1,9 +1,17 @@ FROM microsoft/powershell:ubuntu16.04 MAINTAINER Andrew Schwartzmeyer +LABEL Readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" +LABEL Description="This Dockerfile will install and build the latest release of PS." ARG fork=PowerShell ARG branch=master +SHELL ["powershell", "-command"] +RUN git clone --recursive https://github.com/$env:fork/PowerShell.git -b $env:branch; \ + Set-Location PowerShell; \ + Import-Module ./build.psm1; \ + Start-PSBootstrap -Package -NoSudo; \ + Start-PSBuild -Crossgen; \ + Start-PSPackage; -COPY bootstrap.ps1 / -RUN powershell -f bootstrap.ps1 \ - && dpkg -i PowerShell/powershell*.deb +SHELL ["/bin/sh", "-c"] +RUN dpkg -i PowerShell/powershell*.deb diff --git a/docker/nightly/ubuntu16.04/bootstrap.ps1 b/docker/nightly/ubuntu16.04/bootstrap.ps1 deleted file mode 100644 index d48c9468d3..0000000000 --- a/docker/nightly/ubuntu16.04/bootstrap.ps1 +++ /dev/null @@ -1,8 +0,0 @@ -# This is intended to be used inside Docker containers - -git clone --recursive https://github.com/$env:fork/PowerShell.git -b $env:branch -Set-Location PowerShell -Import-Module ./build.psm1 -Start-PSBootstrap -Package -NoSudo -Start-PSBuild -Crossgen -Start-PSPackage diff --git a/docker/release/nanoserver/Dockerfile b/docker/release/nanoserver/Dockerfile index 4e498c8904..42bb8a7d17 100644 --- a/docker/release/nanoserver/Dockerfile +++ b/docker/release/nanoserver/Dockerfile @@ -2,7 +2,7 @@ FROM microsoft/nanoserver MAINTAINER brycem@microsoft.com LABEL Readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" -LABEL Description="This Dockerfile will install and build the latest release of PS on NanoServer." +LABEL Description="This Dockerfile will install the latest release of PS." ARG POWERSHELL_ZIP=https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.12/powershell-6.0.0-alpha.12-win10-x64.zip ARG POWERSHELL_SHA256=257D5F081C112713DF17F6D0E4CBC794E5099664EDA8DBC543B996915834D5CE @@ -35,9 +35,6 @@ RUN $ErrorActionPreference='Stop'; ` New-Item -Type SymbolicLink -Path $PsFolder\ -Name Core -Value $PsFolder ` } else { throw 'Installation failed! See c:\Dockerfile.log' } ; -# Cleanup %POWERSHELL_SHA256% -ENV POWERSHELL_SHA256= - # Verify New Powershell.exe runs SHELL ["C:\\Program Files\\PowerShell\\Core\\PowerShell.exe", "-command"] RUN Start-Transcript -path C:\Dockerfile.log -append -IncludeInvocationHeader ; ` diff --git a/docker/release/windowsservercore/Dockerfile b/docker/release/windowsservercore/Dockerfile index 42725097dc..3bb01f9690 100644 --- a/docker/release/windowsservercore/Dockerfile +++ b/docker/release/windowsservercore/Dockerfile @@ -2,7 +2,7 @@ FROM microsoft/windowsservercore MAINTAINER brycem@microsoft.com LABEL Readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" -LABEL Description="This Dockerfile will install and build the latest release of PS on WindowsServerCore." +LABEL Description="This Dockerfile will install the latest release of PS." ARG POWERSHELL_MSI=https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.12/PowerShell_6.0.0.12-alpha.12-win10-x64.msi ARG POWERSHELL_SHA256=F3C3F3276462588E24BFE197DAA8795140E37557596861126D54462561C98671 @@ -35,9 +35,6 @@ RUN $ErrorActionPreference='Stop'; ` New-Item -Type SymbolicLink -Path $Env:ProgramFiles\PowerShell\ -Name Core -Value $psexe.DirectoryName ` } else { throw 'Installation failed! See c:\PowerShell-win10-x64.msi.log' } ; -# Cleanup %POWERSHELL_SHA256% -ENV POWERSHELL_SHA256= - # Verify New Powershell.exe runs SHELL ["C:\\Program Files\\PowerShell\\Core\\PowerShell.exe", "-command"] RUN Start-Transcript -path C:\Dockerfile.log -append -IncludeInvocationHeader ; `