FROM aegir/hostmaster

ENV AEGIR_CLIENT_EMAIL aegir@aegir.docker
ENV AEGIR_CLIENT_NAME admin
ENV AEGIR_PROFILE hostmaster
ENV AEGIR_VERSION 7.x-3.6
ENV PROVISION_VERSION 7.x-3.6

USER root

# Remove stock provision, install provision-$PROVISION_VERSION
RUN rm -rf /usr/share/drush/commands/provision
RUN drush dl --destination=/usr/share/drush/commands provision-$PROVISION_VERSION -y

USER aegir

# For Releases:
ENV AEGIR_MAKEFILE http://cgit.drupalcode.org/provision/plain/aegir-release.make?h=$AEGIR_VERSION

# Prepare hostmaster platform.
RUN drush make $AEGIR_MAKEFILE /var/aegir/$AEGIR_PROFILE-$AEGIR_VERSION
RUN drush cc drush

FROM aegir/hostmaster

ENV AEGIR_VERSION 7.x-3.6
ENV AEGIR_MAKEFILE http://cgit.drupalcode.org/provision/plain/aegir-release.make?h=$AEGIR_VERSION

ENV AEGIR_HOSTMASTER_ROOT /var/aegir/$AEGIR_PROFILE-$AEGIR_VERSION

# Prepare next hostmaster platform.
# This is done in the Dockerfile so that we can ship upgrades with the codebase, then run hostmaster-migrate when a new
# version is detected.

RUN drush make $AEGIR_MAKEFILE $AEGIR_HOSTMASTER_ROOT
RUN drush dl provision-$AEGIR_VERSION --destination=/var/aegir/.drush/commands -y
Build platform and get provision in tagged image.
Build platform and get provision in tagged image.
