Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/stdevYuniers_t82_pyskycoin_virtu…
Browse files Browse the repository at this point in the history
…al_env_docker_dev_image' into stdevYuniers_t103_pyskycoin_vscode_docker_dev-image
  • Loading branch information
stdevYuniers committed Jan 20, 2019
2 parents e599d2c + 760f2ae commit 7bf705e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 25 deletions.
52 changes: 34 additions & 18 deletions docker/images/dev-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down Expand Up @@ -142,22 +151,22 @@ 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
$(command -v gpg > /dev/null || echo 'gnupg dirmngr') \
" \
&& 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 \
Expand Down Expand Up @@ -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 '<VERSION>'"
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'; \
Expand Down Expand Up @@ -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

Expand Down
14 changes: 7 additions & 7 deletions docker/images/dev-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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}`.

0 comments on commit 7bf705e

Please sign in to comment.