diff --git a/docker/images/dev-cli/Dockerfile b/docker/images/dev-cli/Dockerfile index 8caf6c53..344d3702 100644 --- a/docker/images/dev-cli/Dockerfile +++ b/docker/images/dev-cli/Dockerfile @@ -39,12 +39,21 @@ RUN set -ex \ wget \ python-pip \ python3-pip \ - && pip install --upgrade pip \ - && pip3 install --upgrade pip + && pip install --upgrade pip virtualenv \ + && pip3 install --upgrade pip virtualenv \ + && mkdir -p /srv/venv/pysky27 \ + && mkdir -p /srv/venv/pysky34 \ + && mkdir -p /srv/venv/pysky35 \ + && mkdir -p /srv/venv/pysky36 \ + && mkdir -p /srv/venv/pysky37 \ + && virtualenv -p python2.7 /srv/venv/pysky27 \ + && /bin/bash -c "source /srv/venv/pysky27/bin/activate && pip install pyskycoin && deactivate" \ + && virtualenv -p python3.5 /srv/venv/pysky35 \ + && /bin/bash -c "source /srv/venv/pysky35/bin/activate && pip install pyskycoin && deactivate" # Install Python 3.7 # runtime dependencies -ENV PYTHON_VERSION 3.7.1 +ENV PYTHON_VERSION="3.7.2" RUN set -ex \ && buildDeps=" \ libexpat1-dev \ @@ -55,14 +64,14 @@ RUN set -ex \ " \ && apt-get install -y $buildDeps --no-install-recommends \ \ - && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ - && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && wget -qO python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -qO python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && for server in ha.pool.sks-keyservers.net \ hkp://p80.pool.sks-keyservers.net:80 \ keyserver.ubuntu.com \ hkp://keyserver.ubuntu.com:80 ;do\ - gpg --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \ + gpg --no-tty -q --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ @@ -93,7 +102,7 @@ RUN set -ex \ # Install Python 3.6 # runtime dependencies -ENV PYTHON_VERSION 3.6.7 +ENV PYTHON_VERSION="3.6.8" RUN set -ex \ && buildDeps=" \ libexpat1-dev \ @@ -104,14 +113,14 @@ RUN set -ex \ " \ && apt-get install -y $buildDeps --no-install-recommends \ \ - && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ - && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && wget -qO python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -qO python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && for server in ha.pool.sks-keyservers.net \ hkp://p80.pool.sks-keyservers.net:80 \ keyserver.ubuntu.com \ hkp://keyserver.ubuntu.com:80 ;do\ - gpg --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \ + gpg --no-tty -q --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ @@ -142,7 +151,7 @@ RUN set -ex \ # Install Python 3.4 # runtime dependencies -ENV PYTHON_VERSION 3.4.9 +ENV PYTHON_VERSION="3.4.9" RUN set -ex \ && buildDeps=" \ # as of Stretch, "gpg" is no longer included by default @@ -150,14 +159,14 @@ RUN set -ex \ " \ && apt-get install -y libssl1.0-dev $buildDeps --no-install-recommends \ \ - && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ - && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && wget -qO python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -qO python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && for server in ha.pool.sks-keyservers.net \ hkp://p80.pool.sks-keyservers.net:80 \ keyserver.ubuntu.com \ hkp://keyserver.ubuntu.com:80 ;do\ - gpg --keyserver "$server" --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D;done \ + gpg --no-tty -q --keyserver "$server" --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D;done \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ && rm -rf "$GNUPGHOME" python.tar.xz.asc \ && mkdir -p /usr/src/python \ @@ -191,7 +200,7 @@ RUN set -ex \ && rm -rf /usr/src/python # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 18.1 +ENV PYTHON_PIP_VERSION="18.1" RUN set -ex; \ \ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ @@ -225,11 +234,18 @@ RUN set -ex; \ rm -f get-pip.py # Install packages in PIP_PACKAGES +# Create python virtualenv with pyskycoin pre-installed RUN pip install --upgrade $PIP_PACKAGES \ && pip3 install --upgrade $PIP_PACKAGES \ - && python3.4 -m pip install --upgrade $PIP_PACKAGES \ - && python3.6 -m pip install --upgrade $PIP_PACKAGES \ - && python3.7 -m pip install --upgrade $PIP_PACKAGES + && python3.4 -m pip install --upgrade $PIP_PACKAGES \ + && python3.6 -m pip install --upgrade $PIP_PACKAGES \ + && python3.7 -m pip install --upgrade $PIP_PACKAGES \ + && virtualenv -p python3.4 /srv/venv/pysky34 \ + && /bin/bash -c "source /srv/venv/pysky34/bin/activate && pip install pyskycoin && deactivate" \ + && virtualenv -p python3.6 /srv/venv/pysky36 \ + && /bin/bash -c "source /srv/venv/pysky36/bin/activate && pip install pyskycoin && deactivate" \ + && virtualenv -p python3.7 /srv/venv/pysky37 \ + && /bin/bash -c "source /srv/venv/pysky37/bin/activate && pip install pyskycoin && deactivate" WORKDIR $GOPATH/src/github.com/skycoin diff --git a/docker/images/dev-cli/README.md b/docker/images/dev-cli/README.md index e856c5b9..948208fe 100644 --- a/docker/images/dev-cli/README.md +++ b/docker/images/dev-cli/README.md @@ -2,10 +2,10 @@ ## Simple Tags -- [`develop` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile) -- [`dind` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile) +- [`develop` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile) +- [`dind` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile) -# Pyskycoin CLI/DIND development image +## Pyskycoin CLI/DIND development image This image (CLI) has the necessary tools to build, test, edit, lint and version the Pyskycoin source code. It comes with some versions of Python (2.7, 3.4, 3.5 and 3.6) and with Vim editor installed, along with some plugins @@ -14,7 +14,7 @@ to ease go development and version control with git. Besides it is possible to use Docker in Docker (DIND) Pyskycoin development image, it is based on `skycoin/skycoindev-cli:dind` and provides all tools included in Pyskycoin CLI image. -# How to use this image +## How to use this image ## Initialize your development environment. @@ -56,7 +56,8 @@ $ docker run --rm \ ### Start a daemon instance ```sh -$ docker run --privileged --name some-name -d skycoin/skycoindev-python:dind +$ docker run --privileged --name some-name \ + -d skycoin/skycoindev-python:dind ``` ### Where to store data @@ -74,7 +75,7 @@ $ docker run --privileged --name some-name \ -d skycoin/skycoindev-python:dind ``` -# Build your own images +## Build your own images The build process relies on the following parameters @@ -116,4 +117,3 @@ and `master` branch on every push made after merging. The same process is triggered for all feature branches matching the pattern `/^([^_]+)_t([0-9]+)_.*docker.*/`. The tag generated for such images will be of the form `feature-{\1}-{\2}`. -