Skip to content

Commit 7bf705e

Browse files
committed
Merge remote-tracking branch 'origin/stdevYuniers_t82_pyskycoin_virtual_env_docker_dev_image' into stdevYuniers_t103_pyskycoin_vscode_docker_dev-image
2 parents e599d2c + 760f2ae commit 7bf705e

File tree

2 files changed

+41
-25
lines changed

2 files changed

+41
-25
lines changed

docker/images/dev-cli/Dockerfile

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,21 @@ RUN set -ex \
3939
wget \
4040
python-pip \
4141
python3-pip \
42-
&& pip install --upgrade pip \
43-
&& pip3 install --upgrade pip
42+
&& pip install --upgrade pip virtualenv \
43+
&& pip3 install --upgrade pip virtualenv \
44+
&& mkdir -p /srv/venv/pysky27 \
45+
&& mkdir -p /srv/venv/pysky34 \
46+
&& mkdir -p /srv/venv/pysky35 \
47+
&& mkdir -p /srv/venv/pysky36 \
48+
&& mkdir -p /srv/venv/pysky37 \
49+
&& virtualenv -p python2.7 /srv/venv/pysky27 \
50+
&& /bin/bash -c "source /srv/venv/pysky27/bin/activate && pip install pyskycoin && deactivate" \
51+
&& virtualenv -p python3.5 /srv/venv/pysky35 \
52+
&& /bin/bash -c "source /srv/venv/pysky35/bin/activate && pip install pyskycoin && deactivate"
4453

4554
# Install Python 3.7
4655
# runtime dependencies
47-
ENV PYTHON_VERSION 3.7.1
56+
ENV PYTHON_VERSION="3.7.2"
4857
RUN set -ex \
4958
&& buildDeps=" \
5059
libexpat1-dev \
@@ -55,14 +64,14 @@ RUN set -ex \
5564
" \
5665
&& apt-get install -y $buildDeps --no-install-recommends \
5766
\
58-
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
59-
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
67+
&& wget -qO python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
68+
&& wget -qO python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
6069
&& export GNUPGHOME="$(mktemp -d)" \
6170
&& for server in ha.pool.sks-keyservers.net \
6271
hkp://p80.pool.sks-keyservers.net:80 \
6372
keyserver.ubuntu.com \
6473
hkp://keyserver.ubuntu.com:80 ;do\
65-
gpg --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \
74+
gpg --no-tty -q --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \
6675
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
6776
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
6877
&& mkdir -p /usr/src/python \
@@ -93,7 +102,7 @@ RUN set -ex \
93102

94103
# Install Python 3.6
95104
# runtime dependencies
96-
ENV PYTHON_VERSION 3.6.7
105+
ENV PYTHON_VERSION="3.6.8"
97106
RUN set -ex \
98107
&& buildDeps=" \
99108
libexpat1-dev \
@@ -104,14 +113,14 @@ RUN set -ex \
104113
" \
105114
&& apt-get install -y $buildDeps --no-install-recommends \
106115
\
107-
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
108-
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
116+
&& wget -qO python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
117+
&& wget -qO python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
109118
&& export GNUPGHOME="$(mktemp -d)" \
110119
&& for server in ha.pool.sks-keyservers.net \
111120
hkp://p80.pool.sks-keyservers.net:80 \
112121
keyserver.ubuntu.com \
113122
hkp://keyserver.ubuntu.com:80 ;do\
114-
gpg --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \
123+
gpg --no-tty -q --keyserver "$server" --recv-keys 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D;done \
115124
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
116125
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
117126
&& mkdir -p /usr/src/python \
@@ -142,22 +151,22 @@ RUN set -ex \
142151

143152
# Install Python 3.4
144153
# runtime dependencies
145-
ENV PYTHON_VERSION 3.4.9
154+
ENV PYTHON_VERSION="3.4.9"
146155
RUN set -ex \
147156
&& buildDeps=" \
148157
# as of Stretch, "gpg" is no longer included by default
149158
$(command -v gpg > /dev/null || echo 'gnupg dirmngr') \
150159
" \
151160
&& apt-get install -y libssl1.0-dev $buildDeps --no-install-recommends \
152161
\
153-
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
154-
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
162+
&& wget -qO python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
163+
&& wget -qO python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
155164
&& export GNUPGHOME="$(mktemp -d)" \
156165
&& for server in ha.pool.sks-keyservers.net \
157166
hkp://p80.pool.sks-keyservers.net:80 \
158167
keyserver.ubuntu.com \
159168
hkp://keyserver.ubuntu.com:80 ;do\
160-
gpg --keyserver "$server" --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D;done \
169+
gpg --no-tty -q --keyserver "$server" --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D;done \
161170
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
162171
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
163172
&& mkdir -p /usr/src/python \
@@ -191,7 +200,7 @@ RUN set -ex \
191200
&& rm -rf /usr/src/python
192201

193202
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
194-
ENV PYTHON_PIP_VERSION 18.1
203+
ENV PYTHON_PIP_VERSION="18.1"
195204
RUN set -ex; \
196205
\
197206
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
@@ -225,11 +234,18 @@ RUN set -ex; \
225234
rm -f get-pip.py
226235

227236
# Install packages in PIP_PACKAGES
237+
# Create python virtualenv with pyskycoin pre-installed
228238
RUN pip install --upgrade $PIP_PACKAGES \
229239
&& pip3 install --upgrade $PIP_PACKAGES \
230-
&& python3.4 -m pip install --upgrade $PIP_PACKAGES \
231-
&& python3.6 -m pip install --upgrade $PIP_PACKAGES \
232-
&& python3.7 -m pip install --upgrade $PIP_PACKAGES
240+
&& python3.4 -m pip install --upgrade $PIP_PACKAGES \
241+
&& python3.6 -m pip install --upgrade $PIP_PACKAGES \
242+
&& python3.7 -m pip install --upgrade $PIP_PACKAGES \
243+
&& virtualenv -p python3.4 /srv/venv/pysky34 \
244+
&& /bin/bash -c "source /srv/venv/pysky34/bin/activate && pip install pyskycoin && deactivate" \
245+
&& virtualenv -p python3.6 /srv/venv/pysky36 \
246+
&& /bin/bash -c "source /srv/venv/pysky36/bin/activate && pip install pyskycoin && deactivate" \
247+
&& virtualenv -p python3.7 /srv/venv/pysky37 \
248+
&& /bin/bash -c "source /srv/venv/pysky37/bin/activate && pip install pyskycoin && deactivate"
233249

234250
WORKDIR $GOPATH/src/github.com/skycoin
235251

docker/images/dev-cli/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## Simple Tags
44

5-
- [`develop` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile)
6-
- [`dind` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile)
5+
- [`develop` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile)
6+
- [`dind` (*docker/images/dev/Dockerfile*)](https://github.com/simelo/pyskycoin/blob/develop/docker/images/dev/Dockerfile)
77

8-
# Pyskycoin CLI/DIND development image
8+
## Pyskycoin CLI/DIND development image
99

1010
This image (CLI) has the necessary tools to build, test, edit, lint and version the Pyskycoin
1111
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.
1414
Besides it is possible to use Docker in Docker (DIND) Pyskycoin development image,
1515
it is based on `skycoin/skycoindev-cli:dind` and provides all tools included in Pyskycoin CLI image.
1616

17-
# How to use this image
17+
## How to use this image
1818

1919
## Initialize your development environment.
2020

@@ -56,7 +56,8 @@ $ docker run --rm \
5656
### Start a daemon instance
5757

5858
```sh
59-
$ docker run --privileged --name some-name -d skycoin/skycoindev-python:dind
59+
$ docker run --privileged --name some-name \
60+
-d skycoin/skycoindev-python:dind
6061
```
6162

6263
### Where to store data
@@ -74,7 +75,7 @@ $ docker run --privileged --name some-name \
7475
-d skycoin/skycoindev-python:dind
7576
```
7677

77-
# Build your own images
78+
## Build your own images
7879

7980
The build process relies on the following parameters
8081

@@ -116,4 +117,3 @@ and `master` branch on every push made after merging. The same process
116117
is triggered for all feature branches matching the pattern
117118
`/^([^_]+)_t([0-9]+)_.*docker.*/`. The tag generated for such images
118119
will be of the form `feature-{\1}-{\2}`.
119-

0 commit comments

Comments
 (0)