diff --git a/Dockerfile b/Dockerfile index 204659f5c05..277fba9bead 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,36 +1,26 @@ -FROM ubuntu:14.04 - -RUN rm /bin/sh && ln -s /bin/bash /bin/sh +FROM ubuntu:15.10 RUN apt-get update -qq && \ apt-get install -qqy --no-install-recommends\ - build-essential \ - curl \ - ca-certificates \ - git \ - python-pip \ - libffi-dev \ - libssl-dev \ - python-dev \ + python3-pip \ vim \ - nano \ jq && \ - rm -rf /var/lib/apt/lists/* && \ - pip install azure==2.0.0a1 && \ - pip install --upgrade requests && \ - pip install cryptography && \ - pip install pyopenssl ndg-httpsclient pyasn1 + rm -rf /var/lib/apt/lists/* + +RUN pip3 install azure==2.0.0a1 -ENV AZURECLITEMP /tmp/azure-cli +ENV AZURECLITEMP /opt/azure-cli ENV PYTHONPATH $PYTHONPATH:$AZURECLITEMP/src ENV PATH $PATH:$AZURECLITEMP RUN mkdir -p $AZURECLITEMP -ADD src $AZURECLITEMP/src +COPY src $AZURECLITEMP/src +COPY az.completion.sh $AZURECLITEMP/ +COPY az $AZURECLITEMP/ -RUN echo '#!/bin/bash'>$AZURECLITEMP/az && \ - echo 'python -m azure.cli "$@"'>>$AZURECLITEMP/az && \ - chmod +x $AZURECLITEMP/az && \ - az +RUN chmod +x $AZURECLITEMP/az +RUN ln /usr/bin/python3 /usr/bin/python +RUN echo "source $AZURECLITEMP/az.completion.sh" >> ~/.bashrc +RUN az -ENV EDITOR vim +ENV EDITOR vim \ No newline at end of file diff --git a/Dockerfile-2.7 b/Dockerfile-2.7 new file mode 100644 index 00000000000..091768d2973 --- /dev/null +++ b/Dockerfile-2.7 @@ -0,0 +1,33 @@ +FROM ubuntu:14.04 + +RUN apt-get update -qq && \ + apt-get install -qqy --no-install-recommends\ + build-essential \ + curl \ + ca-certificates \ + python-pip \ + libffi-dev \ + libssl-dev \ + python-dev \ + vim \ + jq && \ + rm -rf /var/lib/apt/lists/* && \ + pip install azure==2.0.0a1 && \ + pip install --upgrade requests && \ + pip install cryptography && \ + pip install pyopenssl ndg-httpsclient pyasn1 + +ENV AZURECLITEMP /opt/azure-cli +ENV PYTHONPATH $PYTHONPATH:$AZURECLITEMP/src +ENV PATH $PATH:$AZURECLITEMP + +RUN mkdir -p $AZURECLITEMP +COPY src $AZURECLITEMP/src +COPY az.completion.sh $AZURECLITEMP/ +COPY az $AZURECLITEMP/ + +RUN chmod +x $AZURECLITEMP/az +RUN echo "source $AZURECLITEMP/az.completion.sh" >> ~/.bashrc +RUN az + +ENV EDITOR vim \ No newline at end of file diff --git a/az b/az index c4b5a8d6d7b..e7b0cefdac4 100644 --- a/az +++ b/az @@ -10,6 +10,5 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" export PYTHONPATH="${DIR}/src:${PYTHONPATH}" -python -m azure.cli "$@" - +python -m azure.cli "$@"