Skip to content

Commit

Permalink
Merge pull request #10 from petronetto/develop
Browse files Browse the repository at this point in the history
Reducing the container size
  • Loading branch information
petronetto authored May 29, 2019
2 parents c229183 + a7a0a20 commit e1a2f5c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 35 deletions.
47 changes: 33 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,48 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

FROM python:3.6-slim-stretch
FROM debian:stretch-slim

LABEL maintainer="Juliano Petronetto <[email protected]>" \
name="Docker Python Deep Learning" \
description="Docker container for Python Deep Learning, with almost everything that you may need." \
url="https://hub.docker.com/r/petronetto/docker-python-deep-learning" \
vcs-url="https://github.com/petronetto/docker-python-deep-learning" \
vendor="Petronetto DevTech" \
version="1.0"
version="1.1"

ENV BUILD_PACKAGES="\
build-essential \
linux-headers-4.9 \
python3-dev \
cmake \
tcl-dev \
xz-utils \
zlib1g-dev \
libssl-dev \
libncurses5-dev \
libsqlite3-dev \
libreadline-dev \
libtk8.5 \
libgdm-dev \
libdb4o-cil-dev \
libpcap-dev \
git \
curl \
software-properties-common" \
wget \
curl" \
APT_PACKAGES="\
ca-certificates \
openssl \
sqlite3 \
bash \
graphviz \
fonts-noto \
libpng16-16 \
libfreetype6 \
libjpeg62-turbo \
libgomp1 \
ffmpeg" \
libgomp1" \
PIP_PACKAGES="\
pyyaml \
mkl \
pymkl \
cffi \
h5py \
requests \
Expand All @@ -77,18 +85,29 @@ ENV BUILD_PACKAGES="\
xgboost \
tensorflow \
keras \
torch \
torchvision \
https://download.pytorch.org/whl/cpu/torch-1.1.0-cp36-cp36m-linux_x86_64.whl \
https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp36-cp36m-linux_x86_64.whl \
mxnet-mkl" \
PYTHON_VER=3.6.8 \
JUPYTER_CONFIG_DIR=/home/.ipython/profile_default/startup \
LANG=C.UTF-8

RUN set -ex; \
apt-get update -y; \
apt-get upgrade -y; \
apt-get install -y --no-install-recommends ${BUILD_PACKAGES}; \
add-apt-repository ppa:jonathonf/ffmpeg-4; \
apt-get install -y --no-install-recommends ${APT_PACKAGES}; \
apt-get install -y --no-install-recommends ${BUILD_PACKAGES}; \
cd /tmp && wget https://www.python.org/ftp/python/${PYTHON_VER}/Python-${PYTHON_VER}.tgz; \
tar xvf Python-${PYTHON_VER}.tgz; \
cd Python-${PYTHON_VER}; \
./configure --enable-optimizations && make -j8 && make altinstall; \
ln -s /usr/local/bin/python3.6 /usr/local/bin/python; \
ln -s /usr/local/bin/pip3.6 /usr/local/bin/pip; \
ln -s /usr/local/bin/idle3.6 /usr/local/bin/idle; \
ln -s /usr/local/bin/pydoc3.6 /usr/local/bin/pydoc; \
ln -s /usr/local/bin/python3.6m-config /usr/local/bin/python-config; \
ln -s /usr/local/bin/pyvenv-3.6 /usr/local/bin/pyvenv; \
pip install -U -V pip; \
pip install -U -v setuptools wheel; \
pip install -U -v ${PIP_PACKAGES}; \
apt-get remove --purge --auto-remove -y ${BUILD_PACKAGES}; \
Expand All @@ -97,10 +116,10 @@ RUN set -ex; \
apt-get autoremove; \
rm -rf /tmp/* /var/tmp/*; \
rm -rf /var/lib/apt/lists/*; \
rm -rf /var/cache/apt/archives/*.deb \
rm -f /var/cache/apt/archives/*.deb \
/var/cache/apt/archives/partial/*.deb \
/var/cache/apt/*.bin; \
find /usr/lib/python3 -name __pycache__ | xargs rm -rf; \
find / -name __pycache__ | xargs rm -r; \
rm -rf /root/.[acpw]*; \
pip install jupyter && jupyter nbextension enable --py widgetsnbextension; \
mkdir -p ${JUPYTER_CONFIG_DIR}; \
Expand Down
49 changes: 28 additions & 21 deletions Welcome.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3.6.7 (default, Oct 24 2018, 22:50:05) \n",
"3.6.8 (default, Mar 27 2019, 08:53:45) \n",
"[GCC 6.3.0 20170516]\n"
]
}
Expand All @@ -55,14 +55,14 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1.15.4\n"
"1.16.3\n"
]
}
],
Expand All @@ -80,14 +80,14 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.23.4\n"
"0.24.2\n"
]
}
],
Expand All @@ -105,14 +105,14 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1.1.0\n"
"1.2.1\n"
]
}
],
Expand All @@ -130,14 +130,14 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.20.0\n"
"0.20.3\n"
]
}
],
Expand All @@ -155,14 +155,14 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.81\n"
"0.82\n"
]
}
],
Expand All @@ -180,7 +180,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -205,14 +205,14 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3.0.1\n"
"3.0.3\n"
]
}
],
Expand All @@ -230,14 +230,14 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1.12.0\n"
"1.13.1\n"
]
}
],
Expand All @@ -255,7 +255,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand All @@ -264,6 +264,13 @@
"text": [
"2.2.4\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Using TensorFlow backend.\n"
]
}
],
"source": [
Expand All @@ -280,14 +287,14 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.4.1\n"
"1.1.0\n"
]
}
],
Expand All @@ -313,7 +320,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
"version": "3.6.8"
}
},
"nbformat": 4,
Expand Down

0 comments on commit e1a2f5c

Please sign in to comment.