diff --git a/docker/launch.sh b/docker/launch.sh index c3408b97a4..49ada09779 100755 --- a/docker/launch.sh +++ b/docker/launch.sh @@ -2,6 +2,14 @@ set -e +if [[ -z "$FORK" ]]; then + FORK=PowerShell +fi + +if [[ -z "$BRANCH" ]]; then + BRANCH=master +fi + # Build both sets by default if [[ -z "$BUILDS" ]]; then BUILDS="stable unstable" @@ -20,9 +28,10 @@ for build in $BUILDS; do # copy the common script because it lives outside the docker build context if [[ "$build" = "unstable" ]]; then cp bootstrap.ps1 $distro + buildargs="--build-arg fork=$FORK --build-arg branch=$BRANCH" fi # build and tag the image so they can be derived from - docker build -t powershell/powershell:$build-$distro $distro + docker build $buildargs -t powershell/powershell:$build-$distro $distro done cd .. done diff --git a/docker/unstable/bootstrap.ps1 b/docker/unstable/bootstrap.ps1 index eda0de163b..d48c9468d3 100644 --- a/docker/unstable/bootstrap.ps1 +++ b/docker/unstable/bootstrap.ps1 @@ -1,6 +1,6 @@ # This is intended to be used inside Docker containers -git clone --recursive https://github.com/PowerShell/PowerShell.git +git clone --recursive https://github.com/$env:fork/PowerShell.git -b $env:branch Set-Location PowerShell Import-Module ./build.psm1 Start-PSBootstrap -Package -NoSudo diff --git a/docker/unstable/centos7/Dockerfile b/docker/unstable/centos7/Dockerfile index 7d4a73ac0f..0e23c90289 100644 --- a/docker/unstable/centos7/Dockerfile +++ b/docker/unstable/centos7/Dockerfile @@ -1,6 +1,9 @@ FROM powershell/powershell:stable-centos7 MAINTAINER Andrew Schwartzmeyer +ARG fork=PowerShell +ARG branch=master + COPY bootstrap.ps1 / RUN powershell -f bootstrap.ps1 \ && yum install -y PowerShell/powershell*.rpm diff --git a/docker/unstable/ubuntu14.04/Dockerfile b/docker/unstable/ubuntu14.04/Dockerfile index 8b6b5d72c5..8754ba970b 100644 --- a/docker/unstable/ubuntu14.04/Dockerfile +++ b/docker/unstable/ubuntu14.04/Dockerfile @@ -1,6 +1,9 @@ FROM powershell/powershell:stable-ubuntu14.04 MAINTAINER Andrew Schwartzmeyer +ARG fork=PowerShell +ARG branch=master + COPY bootstrap.ps1 / RUN powershell -f bootstrap.ps1 \ && dpkg -i PowerShell/powershell*.deb diff --git a/docker/unstable/ubuntu16.04/Dockerfile b/docker/unstable/ubuntu16.04/Dockerfile index dafb8933fe..f72cc0edfc 100644 --- a/docker/unstable/ubuntu16.04/Dockerfile +++ b/docker/unstable/ubuntu16.04/Dockerfile @@ -1,6 +1,9 @@ FROM powershell/powershell:stable-ubuntu16.04 MAINTAINER Andrew Schwartzmeyer +ARG fork=PowerShell +ARG branch=master + COPY bootstrap.ps1 / RUN powershell -f bootstrap.ps1 \ && dpkg -i PowerShell/powershell*.deb