diff --git a/docker-test/Dockerfile b/docker-test/Dockerfile index c17d790d6..1d763b00e 100644 --- a/docker-test/Dockerfile +++ b/docker-test/Dockerfile @@ -1,23 +1,19 @@ FROM python:3.6-alpine +WORKDIR /root + ENV OAI_SPEC_URL="https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json" ENV SENDGRID_API_KEY $SENDGRID_API_KEY -RUN apk add --no-cache curl -RUN apk add --update bash && rm -rf /var/cache/apk/* +RUN apk add --update --no-cache bash curl -# install Prism -WORKDIR /root +# Install Prism ADD https://raw.githubusercontent.com/stoplightio/prism/master/install.sh install.sh -RUN chmod +x ./install.sh && sync && \ - ./install.sh && \ - rm ./install.sh - -# set up default sendgrid env -WORKDIR /root +RUN sync && bash install.sh +# Set up default SendGrid env RUN mkdir sendgrid-python COPY entrypoint.sh entrypoint.sh -RUN chmod +x entrypoint.sh -ENTRYPOINT ["./entrypoint.sh"] + +ENTRYPOINT ["entrypoint.sh"] CMD ["--mock"] diff --git a/docker-test/entrypoint.sh b/docker-test/entrypoint.sh old mode 100644 new mode 100755 diff --git a/docker/Dockerfile b/docker/Dockerfile index 798b494e0..bbbf56277 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,8 +1,12 @@ FROM ubuntu:xenial + +WORKDIR /root + ENV PYTHON_VERSIONS='python2.7 python3.4 python3.5 python3.6' \ - OAI_SPEC_URL="https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json" + OAI_SPEC_URL="https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json" \ + DEBIAN_FRONTEND=noninteractive -# install testing versions of python, including old versions, from deadsnakes +# Install testing versions of python, including old versions, from deadsnakes RUN set -x \ && apt-get update \ && apt-get install -y --no-install-recommends software-properties-common \ @@ -14,35 +18,29 @@ RUN set -x \ && apt-get purge -y --auto-remove software-properties-common \ && rm -rf /var/lib/apt/lists/* -WORKDIR /root - -# install Prism +# Install Prism ADD https://raw.githubusercontent.com/stoplightio/prism/master/install.sh install.sh -RUN chmod +x ./install.sh && sync && \ - ./install.sh && \ - rm ./install.sh +RUN sync && bash install.sh -# install pip, tox +# Install pip, tox ADD https://bootstrap.pypa.io/get-pip.py get-pip.py -RUN python2.7 get-pip.py && \ - pip install tox && \ - rm get-pip.py +RUN python2.7 get-pip.py && pip install tox -#install pyyaml, six, werkzeug -RUN python3.6 -m pip install pyyaml -RUN python3.6 -m pip install six -RUN Python3.6 -m pip install werkzeug -RUN Python3.6 -m pip install flask +# Install pyyaml, six, werkzeug +RUN python3.6 -m pip install pyyaml six werkzeug flask -# set up default sendgrid env +# Set up default SendGrid env WORKDIR /root/sources -RUN git clone https://github.com/sendgrid/sendgrid-python.git && \ - git clone https://github.com/sendgrid/python-http-client.git + +RUN git clone https://github.com/sendgrid/sendgrid-python.git \ + && git clone https://github.com/sendgrid/python-http-client.git + WORKDIR /root -RUN ln -s /root/sources/sendgrid-python/sendgrid && \ - ln -s /root/sources/python-http-client/python_http_client + +RUN ln -s /root/sources/sendgrid-python/sendgrid \ + && ln -s /root/sources/python-http-client/python_http_client COPY entrypoint.sh entrypoint.sh -RUN chmod +x entrypoint.sh + ENTRYPOINT ["./entrypoint.sh"] CMD ["--mock"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh old mode 100644 new mode 100755