# php Robo task runner container

FROM dkregistry.xai-corp.net:5000/xaicorp/composer:7.3 AS composer
MAINTAINER Richard Morgan <r_morgan@sympatico.ca>

RUN composer global require consolidation/robo ~2.0

RUN composer global config repositories.xaicorp/robo-docker-compose vcs https://git.xai-corp.net/xai-corp.net/robo-docker-compose.git
RUN composer global require xaicorp/robo-docker-compose ~1.0


FROM dkregistry.xai-corp.net:5000/xaicorp/php:7.2
MAINTAINER Richard Morgan <r_morgan@sympatico.ca>

COPY --from=composer /root/.composer /opt/.composer
RUN chmod -R 777 /opt/.composer

RUN mkdir -p /opt/project
WORKDIR /opt/project

ENTRYPOINT ["php", "/opt/.composer/vendor/bin/robo"]

RUN apt-get update && apt-get install -y apt-transport-https software-properties-common ca-certificates curl gnupg-agent\
  && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
  && add-apt-repository \
        "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
        $(lsb_release -cs) \
        stable" \
  && apt-get update && apt-get install -y \
    docker-ce-cli \
 && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose \
 && chmod +x /usr/bin/docker-compose
