From fcc9564b4793dca41790a1510bd6391fa569b514 Mon Sep 17 00:00:00 2001 From: thanhsmind Date: Wed, 26 Jun 2019 09:36:57 +0700 Subject: [PATCH 1/5] Update README.md --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index 76df0ef..3b425cc 100644 --- a/README.md +++ b/README.md @@ -1 +1,35 @@ #Docker image for Python Datascience containers +## SOFTWARE PACKAGES + * musl: standard C library + * lib6-compat: compatibility libraries for glibc + * linux-headers: commonly needed, and an unusual package name from Alpine. + * build-base: used so we include the basic development packages (gcc) + * bash: so we can access /bin/bash + * git: to ease up clones of repos + * ca-certificates: for SSL verification during Pip and easy_install + * freetype: library used to render text onto bitmaps, and provides support font-related operations + * libgfortran: contains a Fortran shared library, needed to run Fortran + * libgcc: contains shared code that would be inefficient to duplicate every time as well as auxiliary helper routines and runtime support + * libstdc++: The GNU Standard C++ Library. This package contains an additional runtime library for C++ programs built with the GNU compiler + * openblas: open source implementation of the BLAS(Basic Linear Algebra Subprograms) API with many hand-crafted optimizations for specific processor types + * tcl: scripting language + * tk: GUI toolkit for the Tcl scripting language + * libssl1.0: SSL shared libraries + +## PYTHON DATA SCIENCE PACKAGES + * numpy: support for large, multi-dimensional arrays and matrices + * matplotlib: plotting library for Python and its numerical mathematics extension NumPy. + * scipy: library used for scientific computing and technical computing + * scikit-learn: machine learning library integrates with NumPy and SciPy + * pandas: library providing high-performance, easy-to-use data structures and data analysis tools + * nltk: suite of libraries and programs for symbolic and statistical natural language processing for English + + +## Command +``` +# For Python 2.7 pull +$ docker pull nguyenphuongthanhf/python-datascience:2.7 +# For Python 3.6 pull +$ docker pull nguyenphuongthanhf/python-datascience:3.6 +$ docker container run --rm -it nguyenphuongthanhf/python-datascience:3.6 python +``` From 4e807dc4f8f920e2ee3ecc7d2f2f50eaad3fb72f Mon Sep 17 00:00:00 2001 From: thanhsmind Date: Wed, 26 Jun 2019 09:42:22 +0700 Subject: [PATCH 2/5] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3b425cc..fa3b7f1 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,6 @@ $ docker pull nguyenphuongthanhf/python-datascience:2.7 # For Python 3.6 pull $ docker pull nguyenphuongthanhf/python-datascience:3.6 $ docker container run --rm -it nguyenphuongthanhf/python-datascience:3.6 python + +docker container run --rm -it -v $(pwd):app nguyenphuongthanhf/python-datascience:latest python ``` From 19ac3919ba0731d3c4c494477cbf77bbbc503de2 Mon Sep 17 00:00:00 2001 From: thanhsmind Date: Thu, 27 Jun 2019 09:52:22 +0700 Subject: [PATCH 3/5] Update Dockerfile add user nonroot --- Dockerfile | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 868880b..a20f389 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,26 @@ FROM alpine:3.8 -LABEL MAINTAINER="Faizan Bashir " +LABEL MAINTAINER="Thanh Nguyen " # Linking of locale.h as xlocale.h # This is done to ensure successfull install of python numpy package # see https://forum.alpinelinux.org/comment/690#comment-690 for more information. -WORKDIR /var/www/ +# CREATE USER THE SAME UID AND WITH PARENT COMPUTER +ARG HOST_USER_UID=1000 +ARG HOST_USER_GID=1000 +ARG HOST_USER_NAME=www +ARG HOST_GROUP_NAME=www + +RUN set -xe \ +&& apk add --no-cache \ +&& echo 'Creating notroot user and group from host' \ +&& addgroup -g ${HOST_USER_GID} -S ${HOST_GROUP_NAME} \ +&& adduser -u ${HOST_USER_UID} -D -S -G ${HOST_GROUP_NAME} ${HOST_USER_NAME} + +RUN mkdir -p /app + +WORKDIR /app # SOFTWARE PACKAGES # * musl: standard C library From 8b4e5c130f4eebeb750445cd260895050d72c976 Mon Sep 17 00:00:00 2001 From: thanhsmind Date: Thu, 27 Jun 2019 14:31:12 +0700 Subject: [PATCH 4/5] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index fa3b7f1..7efc612 100644 --- a/README.md +++ b/README.md @@ -34,4 +34,7 @@ $ docker pull nguyenphuongthanhf/python-datascience:3.6 $ docker container run --rm -it nguyenphuongthanhf/python-datascience:3.6 python docker container run --rm -it -v $(pwd):app nguyenphuongthanhf/python-datascience:latest python + +docker container run -v $(pwd):/app --rm -it -u www nguyenphuongthanhf/python-datascience:latest sh + ``` From d68f0788c58bc4c68105c7f287f0489af20a12e6 Mon Sep 17 00:00:00 2001 From: thanhsmind Date: Fri, 28 Jun 2019 10:39:09 +0700 Subject: [PATCH 5/5] Update README.md --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7efc612..b68c2c9 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,30 @@ $ docker pull nguyenphuongthanhf/python-datascience:2.7 $ docker pull nguyenphuongthanhf/python-datascience:3.6 $ docker container run --rm -it nguyenphuongthanhf/python-datascience:3.6 python -docker container run --rm -it -v $(pwd):app nguyenphuongthanhf/python-datascience:latest python +$ docker container run --rm -it -v $(pwd):app nguyenphuongthanhf/python-datascience:latest python -docker container run -v $(pwd):/app --rm -it -u www nguyenphuongthanhf/python-datascience:latest sh +$ docker container run -v $(pwd):/app --rm -it -u www nguyenphuongthanhf/python-datascience:latest sh + +### create funny worker support + +$ vi ~/.bashrc + +### Add code +friday () { + tty= + tty -s && tty=--tty + docker run \ + $tty \ + --interactive \ + --rm \ + --volume $(pwd):/app \ + --user $(id -u):$(id -g) \ + --env SSH_AUTH_SOCK=$SSH_AUTH_SOCK \ + nguyenphuongthanhf/python-datascience:latest python $@ +} + +### RUN + +$ friday --version ```