chore(dockerfile): Add aws cli to container build (#1099)
chore(dockerfile): Add aws cli to container build (#1099)

Per discussion in spinnaker/spinnaker#2394, adding awscli to container
such that the features added in spinnaker/spinnaker#2941 to enable
an external passwordCommand for a docker registry can be utilized by
AWS users wishing to add their ECR-based docker registries.

Signed-off-by: Joe Hohertz <16a9a54ddf4259952e3c118c763138e83693d7fd@viafoura.com>
FROM openjdk:8

MAINTAINER delivery-engineering@netflix.com

ENV KUBECTL_RELEASE=1.10.3
ENV HEPTIO_BINARY_RELEASE_DATE=2018-06-05

COPY . workdir/

WORKDIR workdir

RUN GRADLE_USER_HOME=cache ./gradlew installDist -x test -Prelease.useLastTag=true && \
  cp -r ./halyard-web/build/install/halyard /opt && \
  cd .. && \
  rm -rf workdir

RUN echo '#!/usr/bin/env bash' | tee /usr/local/bin/hal > /dev/null && \
  echo '/opt/halyard/bin/hal "$@"' | tee /usr/local/bin/hal > /dev/null

RUN chmod +x /usr/local/bin/hal

RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_RELEASE}/bin/linux/amd64/kubectl && \
    chmod +x ./kubectl && \
    mv ./kubectl /usr/local/bin/kubectl

RUN curl -o heptio-authenticator-aws https://amazon-eks.s3-us-west-2.amazonaws.com/${KUBECTL_RELEASE}/${HEPTIO_BINARY_RELEASE_DATE}/bin/linux/amd64/heptio-authenticator-aws && \
  chmod +x ./heptio-authenticator-aws && \
  mv ./heptio-authenticator-aws /usr/local/bin/heptio-authenticator-aws

ENV PATH "$PATH:/usr/local/bin/heptio-authenticator-aws"

RUN useradd -m spinnaker

USER spinnaker

CMD "/opt/halyard/bin/halyard"

FROM openjdk:8

MAINTAINER delivery-engineering@netflix.com

ENV KUBECTL_RELEASE=1.10.3
ENV HEPTIO_BINARY_RELEASE_DATE=2018-06-05

COPY . workdir/

WORKDIR workdir

RUN GRADLE_USER_HOME=cache ./gradlew installDist -x test -Prelease.useLastTag=true && \
  cp -r ./halyard-web/build/install/halyard /opt && \
  cd .. && \
  rm -rf workdir

RUN echo '#!/usr/bin/env bash' | tee /usr/local/bin/hal > /dev/null && \
  echo '/opt/halyard/bin/hal "$@"' | tee /usr/local/bin/hal > /dev/null

RUN chmod +x /usr/local/bin/hal

RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_RELEASE}/bin/linux/amd64/kubectl && \
    chmod +x ./kubectl && \
    mv ./kubectl /usr/local/bin/kubectl

RUN curl -o heptio-authenticator-aws https://amazon-eks.s3-us-west-2.amazonaws.com/${KUBECTL_RELEASE}/${HEPTIO_BINARY_RELEASE_DATE}/bin/linux/amd64/heptio-authenticator-aws && \
  chmod +x ./heptio-authenticator-aws && \
  mv ./heptio-authenticator-aws /usr/local/bin/heptio-authenticator-aws

ENV PATH "$PATH:/usr/local/bin/heptio-authenticator-aws"

RUN wget -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py && \
    python /tmp/get-pip.py && \
    pip install awscli --upgrade

RUN useradd -m spinnaker

USER spinnaker

CMD "/opt/halyard/bin/halyard"
