Skip to content

Commit 4b7fb14

Browse files
committed
first commit
1 parent 861da2a commit 4b7fb14

File tree

4 files changed

+116
-2
lines changed

4 files changed

+116
-2
lines changed

.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# General
2+
.DS_Store
3+
.AppleDouble
4+
.LSOverride
5+
6+
# Icon must end with two \r
7+
Icon
8+
9+
# Thumbnails
10+
._*
11+
12+
# Files that might appear in the root of a volume
13+
.DocumentRevisions-V100
14+
.fseventsd
15+
.Spotlight-V100
16+
.TemporaryItems
17+
.Trashes
18+
.VolumeIcon.icns
19+
.com.apple.timemachine.donotpresent
20+
21+
# Directories potentially created on remote AFP share
22+
.AppleDB
23+
.AppleDesktop
24+
Network Trash Folder
25+
Temporary Items
26+
.apdisk
27+
28+
.idea

Dockerfile

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
FROM alpine:latest
2+
MAINTAINER Feng Zheng
3+
4+
# installs Python 3 and pip
5+
RUN apk add --no-cache python3 && \
6+
if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \
7+
\
8+
python3 -m ensurepip && \
9+
rm -r /usr/lib/python*/ensurepip && \
10+
pip3 install --no-cache --upgrade pip setuptools wheel && \
11+
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi
12+
13+
# installs data science packages
14+
RUN apk add --no-cache \
15+
--virtual=.build-dependencies \
16+
g++ gcc gfortran file binutils \
17+
musl-dev python3-dev cython \
18+
openblas-dev postgresql-dev && \
19+
apk add libstdc++ openblas openssh-client openssl postgresql-libs && \
20+
\
21+
ln -s locale.h /usr/include/xlocale.h && \
22+
\
23+
pip install --upgrade cython && \
24+
pip install psycopg2 && \
25+
pip install numpy && \
26+
pip install pandas && \
27+
pip install scipy && \
28+
pip install scikit-learn && \
29+
\
30+
rm -r /root/.cache && \
31+
find /usr/lib/python3.*/ -name 'tests' -exec rm -r '{}' + && \
32+
find /usr/lib/python3.*/site-packages/ -name '*.so' -print -exec sh -c 'file "{}" | grep -q "not stripped" && strip -s "{}"' \; && \
33+
\
34+
rm /usr/include/xlocale.h && \
35+
\
36+
apk del .build-dependencies
37+
38+
# Add pycddlib and cvxopt with GLPK
39+
RUN cd /tmp && \
40+
apk add --no-cache \
41+
--virtual=.build-dependencies \
42+
gcc make file binutils \
43+
musl-dev python3-dev cython gmp-dev suitesparse-dev openblas-dev && \
44+
apk add gmp suitesparse && \
45+
\
46+
pip install pycddlib && \
47+
\
48+
wget "ftp://ftp.gnu.org/gnu/glpk/glpk-4.65.tar.gz" && \
49+
tar xzf "glpk-4.65.tar.gz" && \
50+
cd "glpk-4.65" && \
51+
./configure --disable-static && \
52+
make -j4 && \
53+
make install-strip && \
54+
CVXOPT_BLAS_LIB=openblas CVXOPT_LAPACK_LIB=openblas CVXOPT_BUILD_GLPK=1 pip install --global-option=build_ext --global-option="-I/usr/include/suitesparse" cvxopt && \
55+
\
56+
rm -r /root/.cache && \
57+
find /usr/lib/python3.*/site-packages/ -name '*.so' -print -exec sh -c 'file "{}" | grep -q "not stripped" && strip -s "{}"' \; && \
58+
\
59+
apk del .build-dependencies && \
60+
rm -rf /tmp/*

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
all: build
2+
.PHONY: build
3+
build:
4+
docker build --rm=true -t python-base:latest -f Dockerfile .

README.md

+24-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
1-
# docker-python-base
2-
Docker image for base python 3 support with data science packages
1+
Python Base Docker Image
2+
================
3+
4+
Docker image for base Python 3 support with data science packages
5+
6+
## Major Features
7+
- **Python 3**: with pip - Python Package Installer
8+
- **NumPy**: a fundamental package for scientific computing with Python.
9+
- **pandas**: an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language.
10+
- **SciPy**: an open-source software for mathematics, science, and engineering.
11+
- **scikit-learn**: a free software machine learning library for the Python programming language. It features various classification, regression and clustering algorithms including support vector machines, random forests, gradient boosting, k-means and DBSCAN, and is designed to interoperate with the Python numerical and scientific libraries NumPy and SciPy.
12+
- **GLPK**: a package is intended for solving large-scale linear programming (LP), mixed integer programming (MIP), and other related problems
13+
- **Psycopg2**: Psycopg is the most popular PostgresSQL adapter for the Python programming language. At its core it fully implements the Python DB API 2.0 specifications.
14+
15+
## Usage
16+
```bash
17+
make build
18+
```
19+
20+
-----
21+
22+
Licensing
23+
=========
24+
MIT License

0 commit comments

Comments
 (0)