Skip to content

Commit 4fb06e7

Browse files
committed
Added Python 3.11
1 parent 4d0772b commit 4fb06e7

15 files changed

Lines changed: 764 additions & 5 deletions

File tree

alpine-3.15/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Usual Docker tag: alp315-py397 (infrahelpers/python-light:alp315-py397)
55
#
66
# See also
7-
# * Alpine 3.15 (featuring Python 3.9.7)
7+
# * Alpine 3.15 (featuring Python 3.9.16)
88
# * Image on Docker Hub/Cloud: https://hub.docker.com/_/alpine
99
# * Dockerfile: https://github.com/alpinelinux/docker-alpine/blob/v3.15/x86_64/Dockerfile
1010
#

alpine-3.16/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#
22
# Source: https://github.com/machine-learning-helpers/docker-python-light/tree/master/alpine-3.16/Dockerfile
33
# On Docker Hub: https://hub.docker.com/repository/docker/infrahelpers/python-light/general
4-
# Usual Docker tag: alp316-py3104 (infrahelpers/python-light:alp316-py3104)
4+
# Usual Docker tag: alp316-py310 (infrahelpers/python-light:alp316-py310)
55
#
66
# See also
7-
# * Alpine 3.16 (featuring Python 3.10.4)
7+
# * Alpine 3.16 (featuring Python 3.10.9)
88
# * Image on Docker Hub/Cloud: https://hub.docker.com/_/alpine
99
# * Dockerfile: https://github.com/alpinelinux/docker-alpine/blob/v3.16/x86_64/Dockerfile
1010
#

python-3.10-alpine-3.16/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# + Dockerfile: https://github.com/docker-library/python/blob/master/3.10/alpine3.16/Dockerfile
1010
# * The best Docker base image for your Python application, Apr. 2020:
1111
# https://pythonspeed.com/articles/base-image-python-docker-images/
12-
# * Alpine 3.16 (featuring Python 3.10.4)
12+
# * Alpine 3.16 (featuring Python 3.10.9)
1313
# + Image on Docker Hub/Cloud: https://hub.docker.com/_/alpine
1414
# + Dockerfile: https://github.com/alpinelinux/docker-alpine/blob/v3.16/x86_64/Dockerfile
1515
#

python-3.11-alpine-3.16/Dockerfile

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#
2+
# Source: https://github.com/machine-learning-helpers/docker-python-light/tree/master/python-3.11-alpine-3.16/Dockerfile
3+
# On Docker Hub: https://hub.docker.com/repository/docker/artificialintelligence/python-light/general
4+
# Usual Docker tag: py310-alp316 (infrahelpers/python-light:py311-alp316)
5+
#
6+
# See also:
7+
# * Python 3.11 Alpine 3.16:
8+
# + Image on Docker Hub/Cloud: https://hub.docker.com/_/python?tab=tags&page=1&name=3.11-alpine3.16
9+
# + Dockerfile: https://github.com/docker-library/python/blob/master/3.11/alpine3.16/Dockerfile
10+
# * The best Docker base image for your Python application, Apr. 2020:
11+
# https://pythonspeed.com/articles/base-image-python-docker-images/
12+
# * Alpine 3.16 (featuring Python 3.10.9)
13+
# + Image on Docker Hub/Cloud: https://hub.docker.com/_/alpine
14+
# + Dockerfile: https://github.com/alpinelinux/docker-alpine/blob/v3.16/x86_64/Dockerfile
15+
#
16+
FROM python:3.11-alpine3.16
17+
18+
LABEL authors="Denis Arnaud <denis.arnaud_github at m4x dot org>"
19+
20+
# Tell Docker about the server port
21+
EXPOSE 5000
22+
23+
#
24+
ENV HOME /root
25+
26+
# Install the Python dependencies
27+
WORKDIR $HOME
28+
RUN apk update && \
29+
apk add net-tools tzdata sudo curl wget less htop \
30+
bzip2-dev xz-dev zlib-dev util-linux-dev coreutils \
31+
dpkg-dev dpkg expat-dev findutils \
32+
libstdc++ gdbm-dev libc-dev \
33+
autoconf automake libtool \
34+
man-pages bash bash-doc bash-completion git vim \
35+
musl linux-headers build-base ca-certificates \
36+
gcc libgcc g++ gfortran cython file libffi-dev libressl-dev \
37+
musl-dev lapack-dev openblas-dev freetype-dev \
38+
openssl-dev libnsl-dev libressl-dev \
39+
ncurses-dev readline-dev tk-dev tcl-dev lcms2-dev \
40+
jpeg-dev openjpeg-dev tiff-dev \
41+
sqlite-dev postgresql-dev libxml2-dev libxslt-dev make jq \
42+
python3-dev py3-pip py3-setuptools py3-wheel py3-pytest py3-tox \
43+
py3-psutil py3-scipy \
44+
rust cargo
45+
46+
RUN python3 -mpip install -U pip
47+
RUN python3 -mpip install -U build
48+
RUN python3 -mpip install -U dill joblib
49+
RUN python3 -mpip install -U twine
50+
RUN python3 -mpip install -U sphinx poetry
51+
RUN python3 -mpip install -U flake8 black mypy
52+
RUN python3 -mpip install -U simplejson
53+
#RUN python3 -mpip install -U pyjq
54+
RUN python3 -mpip install -U pyyaml
55+
RUN python3 -mpip install -U protobuf
56+
RUN python3 -mpip install -U numpy
57+
RUN python3 -mpip install -U pandas
58+
RUN python3 -mpip install -U pandas-datareader
59+
RUN python3 -mpip install -U matplotlib
60+
RUN python3 -mpip install -U seaborn
61+
RUN python3 -mpip install -U scikit-learn
62+
RUN python3 -mpip install -U psycopg2
63+
RUN python3 -mpip install -U opentraveldata OpenTrepWrapper neobase
64+
65+
RUN rm -rf /var/cache/apk/*
66+
#RUN apk del .build-deps
67+
68+
#
69+
#ENTRYPOINT ["/bin/bash"]
70+
CMD ["/bin/bash"]
71+

python-3.11-bullseye/Dockerfile

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
#
2+
# Source: https://github.com/machine-learning-helpers/docker-python-light/tree/master/docker/python-3.11-bullseye/Dockerfile
3+
# On Docker Hub: https://hub.docker.com/repository/docker/infrahelpers/python-light/general
4+
# Usual Docker tag: py311-bullseye (infrahelpers/python-light:py311-bullseye)
5+
#
6+
7+
# See also:
8+
# * Python 3.11 Debian Bullseye:
9+
# + Image on Docker Hub/Cloud: https://hub.docker.com/_/python?tab=tags&page=1&name=3.11-bullseye
10+
# + Dockerfile: https://github.com/docker-library/python/blob/master/3.11/bullseye/Dockerfile
11+
# * The best Docker base image for your Python application, Apr. 2020:
12+
# https://pythonspeed.com/articles/base-image-python-docker-images/
13+
# * General purpose Debian 11 (Bullseye) C++/Python development image:
14+
# + Docker Hub: https://cloud.docker.com/u/infrahelpers/repository/docker/infrahelpers/cpppython
15+
# + Dockerfile: https://github.com/cpp-projects-showcase/docker-images/tree/master/debian11
16+
#
17+
FROM python:3.11-bullseye
18+
19+
LABEL authors="Denis Arnaud <denis.arnaud_github at m4x dot org>"
20+
21+
# Tell Docker about the server port
22+
EXPOSE 5000
23+
24+
# Environment
25+
ENV container docker
26+
ENV HOME /root
27+
ENV LANGUAGE en_US:en
28+
ENV LANG en_US.UTF-8
29+
ENV LANG4GEN en_US.utf8
30+
ENV LC_ALL $LANG
31+
32+
# Update the system
33+
#RUN echo "Europe/Paris" > /etc/timezone
34+
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-yes
35+
RUN apt-get -qq update
36+
RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends \
37+
apt-utils apt-transport-https \
38+
ca-certificates locales locales-all tzdata sudo \
39+
zip unzip gzip bzip2 xz-utils tar p7zip-full \
40+
curl wget netcat net-tools aptitude
41+
42+
# Generate the locales
43+
RUN locale-gen $LANG && \
44+
update-locale LANG=$LANG LANGUAGE=$LANGUAGE LC_ALL=$LC_ALL
45+
46+
# Configure the time-zone
47+
RUN dpkg-reconfigure -f noninteractive tzdata
48+
49+
# Basic, C++ and Python packages
50+
RUN apt-get -qq update && \
51+
apt-get -y install procps less htop screen \
52+
git keychain gawk \
53+
bash-completion vim-nox emacs-nox apt-utils keyutils ftp \
54+
zlib1g-dev libbz2-dev \
55+
lsb-release libgmp-dev \
56+
gcc g++ cppcheck clang cmake manpages patch pkg-config \
57+
m4 autoconf automake libtool libltdl-dev build-essential \
58+
flex bison \
59+
libboost-all-dev libxapian-dev \
60+
libreadline-dev libncurses5-dev \
61+
libzmq5-dev libczmq-dev libssl-dev libffi-dev \
62+
swig graphviz libopenblas-dev
63+
RUN apt-get -y install libmpich-dev libopenmpi-dev \
64+
sqlite3 libsqlite3-dev \
65+
mariadb-client default-libmysqlclient-dev \
66+
postgresql-client \
67+
libpqxx-dev \
68+
libicu-dev libprotobuf-dev protobuf-compiler \
69+
python3 libpython3-dev \
70+
python3-django libapache2-mod-wsgi-py3 \
71+
libgeos++-dev \
72+
doxygen ghostscript texlive-latex-recommended \
73+
r-base r-base-dev \
74+
rake \
75+
jq
76+
77+
# Cleaning
78+
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
79+
80+
# yq, the YAML CLI utility like jq, for YAML (https://github.com/mikefarah/yq)
81+
RUN YQ_VER=$(curl -Ls https://api.github.com/repos/mikefarah/yq/releases/latest | grep 'tag_name' | cut -d'v' -f2 | cut -d'"' -f1) && \
82+
curl -Ls \
83+
https://github.com/mikefarah/yq/releases/download/v${YQ_VER}/yq_linux_amd64 \
84+
-o /usr/local/bin/yq && \
85+
chmod 775 /usr/local/bin/yq
86+
87+
# SOCI (https://github.com/SOCI/soci)
88+
RUN mkdir -p /opt/soci
89+
ADD resources/soci-debian-cmake.patch /opt/soci/soci-debian-cmake.patch
90+
RUN SOCI_VER=$(curl -Ls https://api.github.com/repos/SOCI/soci/tags|jq -r '.[].name'|grep "^v"|sort -r|head -1|cut -d'v' -f2,2) && \
91+
curl -Ls \
92+
https://github.com/SOCI/soci/archive/refs/tags/v${SOCI_VER}.tar.gz \
93+
-o /opt/soci/soci-${SOCI_VER}.tar.gz && cd /opt/soci && \
94+
tar zxf soci-${SOCI_VER}.tar.gz && rm -f soci-${SOCI_VER}.tar.gz && \
95+
cd soci-${SOCI_VER} && patch -p1 < ../soci-debian-cmake.patch && \
96+
mkdir -p build && cd build && \
97+
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \
98+
-DSOCI_CXX11=ON -DSOCI_TESTS=OFF .. && \
99+
make install
100+
101+
# Set up the packaging environment for the `build` user
102+
ADD resources/bashrc $HOME/.bashrc
103+
ADD resources/gitconfig $HOME/.gitconfig
104+
ADD resources/vimrc $HOME/.vimrc
105+
RUN chmod 640 $HOME/.bashrc $HOME/.gitconfig $HOME/.vimrc
106+
107+
# Install a few Python modules for data science
108+
WORKDIR $HOME
109+
RUN python3 -mpip install -U pip
110+
RUN python3 -mpip install -U psutil dill joblib
111+
RUN python3 -mpip install -U setuptools wheel build scikit-build
112+
RUN python3 -mpip install -U pytest tox twine
113+
#RUN python3 -mpip install -U pyjq pyyaml
114+
RUN python3 -mpip install -U numpy pandas pandas-datareader
115+
RUN python3 -mpip install -U scikit-learn
116+
RUN python3 -mpip install -U matplotlib seaborn
117+
RUN python3 -mpip install -U dash flask flask_restful connexion requests
118+
RUN python3 -mpip install -U ipython jupyterlab
119+
RUN python3 -mpip install -U opentraveldata OpenTrepWrapper Neobase
120+
RUN python3 -mpip install -U elasticsearch kafka-python
121+
RUN python3 -mpip install -U psycopg2
122+
123+
#
124+
CMD ["/bin/bash"]
125+
126+
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# ~/.bashrc: executed by bash(1) for non-login shells.
2+
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
3+
# for examples
4+
5+
# If not running interactively, don't do anything
6+
case $- in
7+
*i*) ;;
8+
*) return;;
9+
esac
10+
11+
# don't put duplicate lines or lines starting with space in the history.
12+
# See bash(1) for more options
13+
HISTCONTROL=ignoreboth
14+
15+
#
16+
HISTTIMEFORMAT="%d/%m/%y %T "
17+
18+
# append to the history file, don't overwrite it
19+
shopt -s histappend
20+
21+
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
22+
HISTSIZE=1000
23+
HISTFILESIZE=2000
24+
25+
# check the window size after each command and, if necessary,
26+
# update the values of LINES and COLUMNS.
27+
shopt -s checkwinsize
28+
29+
# SSH
30+
# keychain ~/.ssh/id_rsa
31+
# source ~/.keychain/$(hostname)-sh
32+
33+
# If set, the pattern "**" used in a pathname expansion context will
34+
# match all files and zero or more directories and subdirectories.
35+
#shopt -s globstar
36+
37+
# make less more friendly for non-text input files, see lesspipe(1)
38+
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
39+
40+
# set variable identifying the chroot you work in (used in the prompt below)
41+
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
42+
debian_chroot=$(cat /etc/debian_chroot)
43+
fi
44+
45+
# set a fancy prompt (non-color, unless we know we "want" color)
46+
case "$TERM" in
47+
xterm-color|*-256color) color_prompt=yes;;
48+
esac
49+
50+
# uncomment for a colored prompt, if the terminal has the capability; turned
51+
# off by default to not distract the user: the focus in a terminal window
52+
# should be on the output of commands, not on the prompt
53+
force_color_prompt=yes
54+
55+
if [ -n "$force_color_prompt" ]; then
56+
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
57+
# We have color support; assume it's compliant with Ecma-48
58+
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
59+
# a case would tend to support setf rather than setaf.)
60+
color_prompt=yes
61+
else
62+
color_prompt=
63+
fi
64+
fi
65+
66+
if [ "$color_prompt" = yes ]; then
67+
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
68+
else
69+
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
70+
fi
71+
unset color_prompt force_color_prompt
72+
73+
# If this is an xterm set the title to user@host:dir
74+
case "$TERM" in
75+
xterm*|rxvt*)
76+
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
77+
;;
78+
*)
79+
;;
80+
esac
81+
82+
# Git prompt
83+
if [ -f ~/.bash-git-prompt/gitprompt.sh ]
84+
then
85+
GIT_PROMPT_ONLY_IN_REPO=1
86+
source ~/.bash-git-prompt/gitprompt.sh
87+
fi
88+
89+
# Python pyenv
90+
export PYENV_ROOT="${HOME}/.pyenv"
91+
export PATH="${PYENV_ROOT}/bin:${PATH}"
92+
93+
if command -v pyenv 1>/dev/null 2>&1; then
94+
eval "$(pyenv init -)"
95+
fi
96+
97+
# enable color support of ls and also add handy aliases
98+
if [ -x /usr/bin/dircolors ]; then
99+
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
100+
alias ls='ls --color=auto'
101+
alias dir='ls -laFh --color=auto'
102+
#alias vdir='vdir --color=auto'
103+
104+
alias grep='grep --color=auto'
105+
alias fgrep='fgrep --color=auto'
106+
alias egrep='egrep --color=auto'
107+
fi
108+
109+
# colored GCC warnings and errors
110+
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
111+
112+
# some more ls aliases
113+
alias ll='ls -alF'
114+
alias la='ls -A'
115+
alias l='ls -CF'
116+
117+
# Add an "alert" alias for long running commands. Use like so:
118+
# sleep 10; alert
119+
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
120+
121+
# Alias definitions.
122+
# You may want to put all your additions into a separate file like
123+
# ~/.bash_aliases, instead of adding them here directly.
124+
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
125+
126+
if [ -f ~/.bash_aliases ]; then
127+
. ~/.bash_aliases
128+
fi
129+
130+
# enable programmable completion features (you don't need to enable
131+
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
132+
# sources /etc/bash.bashrc).
133+
if ! shopt -oq posix; then
134+
if [ -f /usr/share/bash-completion/bash_completion ]; then
135+
. /usr/share/bash-completion/bash_completion
136+
elif [ -f /etc/bash_completion ]; then
137+
. /etc/bash_completion
138+
fi
139+
fi
140+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[alias]
2+
st = status
3+
cl = clone
4+
co = checkout
5+
ci = commit
6+
br = branch
7+
fe = fetch
8+
pl = pull
9+
ps = push
10+
11+
[push]
12+
default = tracking
13+
14+
[pull]
15+
rebase = false
16+
17+
[color]
18+
ui = auto
19+

0 commit comments

Comments
 (0)