├── .gitignore ├── README.md ├── conda ├── 2.7 │ ├── Dockerfile │ ├── README.md │ ├── anaconda_license.txt │ └── conda_install.sh ├── 3.4 │ ├── Dockerfile │ ├── README.md │ ├── anaconda_license.txt │ └── conda_install.sh └── README.md ├── pyrun ├── 2.7 │ ├── Dockerfile │ ├── README.md │ ├── eGenix.com-Public-License-1.1.0.pdf │ └── pyrun2.7 └── 3.4 │ ├── Dockerfile │ ├── README.md │ ├── eGenix.com-Public-License-1.1.0.pdf │ └── pyrun3.4 └── staticpython ├── Dockerfile ├── README.md └── python2.7-static /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | docker 2 | ====== 3 | 4 | A collection of docker recipes: 5 | 6 | * **elyase/staticpython**: Probably the smallest docker image for python. The total image size is only **8.5 MB**. 7 | * **elyase/pyrun**: A small docker image for python with only **18.44 MB** based on `pyrun`. 8 | * **elyase/conda**: A light but fully functional python conda image. This is recommended if you want to use the scientific stack (numpy, pandas, ipython, sklearn) where the conda packaging system shines. 9 | ### Credits 10 | 11 | [@elyase](http://yasermartinez.com) 12 | -------------------------------------------------------------------------------- /conda/2.7/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal python container 2 | # based on [progrium/busybox](https://github.com/progrium/busybox) and [Anaconda Python Distribution](https://store.continuum.io/cshop/anaconda/) 3 | 4 | FROM progrium/busybox 5 | MAINTAINER Yaser Martinez Palenzuela 6 | RUN opkg-install bash bzip2 zlib 7 | ADD conda_install.sh /root/conda_install.sh 8 | RUN ["bash", "/root/conda_install.sh"] 9 | ENV PATH /root/miniconda/bin:$PATH 10 | -------------------------------------------------------------------------------- /conda/2.7/README.md: -------------------------------------------------------------------------------- 1 | elyase/conda 2 | ============ 3 | 4 | A minimal python docker image based on [progrium/busybox](https://github.com/progrium/busybox) and the [Anaconda Python Distribution](https://store.continuum.io/cshop/anaconda/) 5 | 6 | The total weight of theis image is **88.97**. For comparison a `ubuntu:14.04` base image (without python) is 195 MB in size and typical python distribution needs aproximately another 100 MBs. When you add the compilation toolchain and dependencies you get the official python docker image, which is close to 900MB in size. 7 | 8 | The intended use of this recipe is to serve as base image for scientific stack (numpy, pandas, ipython, sklearn) applications where the conda packaging system shines. For an even smaller image see `elyase/pyrun` (**18.44 MB**) 9 | 10 | ### So what is missing? 11 | 12 | Nothing of importance should be missing. In order to reduce the size I used a really small base image ([progrium/busybox](https://github.com/progrium/busybox)), cleaned conda cache files, deleted python `.pyc` files (this should be automatically regenerated but depending on your use case this could affect performance) and the tests folders (unittest is still there). 13 | 14 | ### Credits 15 | 16 | [@elyase](http://yasermartinez.com) 17 | 18 | -------------------------------------------------------------------------------- /conda/2.7/anaconda_license.txt: -------------------------------------------------------------------------------- 1 | =================================== 2 | Anaconda END USER LICENSE AGREEMENT 3 | =================================== 4 | Anaconda ("the Software Product") and accompanying documentation is 5 | licensed and not sold. The Software Product is protected by copyright laws 6 | and treaties, as well as laws and treaties related to other forms of 7 | intellectual property. Continuum Analytics Inc or its subsidiaries, 8 | affiliates, and suppliers (collectively "Continuum ") own intellectual 9 | property rights in the Software Product. The Licensee's ("you" or "your") 10 | license to download, use, copy, or change the Software Product is subject 11 | to these rights and to all the terms and conditions of this End User 12 | License Agreement ("Agreement"). 13 | 14 | In addition to Continuum-licensed software, the Software product contains a 15 | collection of software packages from other sources ("Other Vendor Tools"). 16 | Continuum may also distribute updates to these packages on an "as is" basis 17 | and subject to their individual license agreements. These licenses are 18 | available either in the package itself or via request to info@continuum.io. 19 | Continuum reserves the right to change which Other Vendor Tools are 20 | provided in Anaconda. 21 | 22 | Attribution License 23 | =================== 24 | Redistribution and derivative use of Anaconda, with or without 25 | modification, in source or binary form is explicitly permitted provided 26 | that: 27 | 28 | 1. You include a copy of this EULA in all copies of the derived software. 29 | 2. In advertising and labeling material for products built with Anaconda 30 | you mention that your product either includes or derives from Anaconda. 31 | "Powered by Anaconda" is the suggested phrase. 32 | 33 | 34 | Export Regulations 35 | ================== 36 | Any use or distribution of Anaconda is made under conditions that the user 37 | and/or distributor is in full compliance with all export and other 38 | governing laws of the United States of America, including full and ongoing 39 | compliance with the Export Administration Regulations (EAR) of the United 40 | States Department of Commerce. See www.commerce.gov/ and 41 | http://www.bis.doc.gov/index.php/regulations/export-administration- 42 | regulations-ear. Use or distribution of Continuum software products to any 43 | persons, entities or countries currently under US sanctions is strictly 44 | prohibited. Anaconda is classified with an ECCN of 5D992 with no license 45 | required for export to non-embargoed countires. 46 | 47 | The United States currently has embargoes against Cuba, Iran, North Korea, 48 | Sudan and Syria. The exportation, re-exportation, sale or supply, directly 49 | or indirectly, from the United States, or by a U.S. person wherever 50 | located, of any Continuum software to any of these countries is strictly 51 | prohibited without prior authorization by the United States Government By 52 | accepting this Agreement, you represent to Continuum that you will comply 53 | with all applicable export regulations for Anaconda. 54 | 55 | No Implied Warranty or Fitness for Any Use 56 | ========================================== 57 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 58 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 59 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 60 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 61 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 62 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 63 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 64 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 65 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 66 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 67 | POSSIBILITY OF SUCH DAMAGE -------------------------------------------------------------------------------- /conda/2.7/conda_install.sh: -------------------------------------------------------------------------------- 1 | URL=http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh 2 | 3 | # Install dir 4 | PREFIX=$HOME/miniconda 5 | mkdir -p $PREFIX 6 | 7 | # Download Miniconda 8 | wget -q $URL -P $PREFIX 9 | 10 | # Extract packages 11 | cd $PREFIX 12 | LINES=$(cat Miniconda* | grep 'MD5=' | cut -d' ' -f3) 13 | tail -n $LINES Miniconda* | tar -xf - 14 | 15 | extract_dist() 16 | { 17 | echo "installing: $1 ..." 18 | DIST=pkgs/$(basename $1 .tar.bz2) 19 | mkdir -p $DIST 20 | bunzip2 -c ${DIST}.tar.bz2 | tar xf - -C $DIST 21 | rm -f ${DIST}.tar.bz2 22 | } 23 | 24 | for x in pkgs/*.tar.bz2; do extract_dist $x; done 25 | 26 | # Install miniconda 27 | mkdir $PREFIX/envs 28 | mkdir $HOME/.continuum 2>/dev/null 29 | 30 | PYTHON="$(ls $PREFIX/pkgs/python-*/bin/python) -E" 31 | CONDA_INSTALL=$(ls $PREFIX/pkgs/conda-*/lib/python*/site-packages/conda/install.py) 32 | $PYTHON $CONDA_INSTALL --prefix=$PREFIX --pkgs-dir=$PREFIX/pkgs --link-all 33 | 34 | # config 35 | export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PREFIX/bin 36 | conda config --set always_yes True 37 | 38 | # this is needed for libraries like sklearn 39 | conda install -c https://conda.binstar.org/zhenxieit libstdcplus 40 | 41 | ## clean to reduce image size 42 | 43 | # delete tests 44 | find . -type d -name tests -depth -exec rm -rf {} \; 45 | find . -type d -name test -depth -exec rm -rf {} \; 46 | 47 | # remove .pyc 48 | find . -name \__pycache__ -depth -exec rm -rf {} \; 49 | 50 | # remove pkgs cache 51 | rm -r pkgs/* 52 | 53 | #remove installer 54 | rm Miniconda*.sh 55 | -------------------------------------------------------------------------------- /conda/3.4/Dockerfile: -------------------------------------------------------------------------------- 1 | # Minimal python container 2 | # based on [progrium/busybox](https://github.com/progrium/busybox) and [Anaconda Python Distribution](https://store.continuum.io/cshop/anaconda/) 3 | 4 | FROM progrium/busybox 5 | MAINTAINER Yaser Martinez Palenzuela 6 | RUN opkg-install bash bzip2 7 | ADD conda_install.sh /root/conda_install.sh 8 | RUN ["bash", "/root/conda_install.sh"] 9 | ENV PATH /root/miniconda3/bin:$PATH 10 | -------------------------------------------------------------------------------- /conda/3.4/README.md: -------------------------------------------------------------------------------- 1 | elyase/conda 2 | ============ 3 | 4 | A minimal python docker image based on [progrium/busybox](https://github.com/progrium/busybox) and the [Anaconda Python Distribution](https://store.continuum.io/cshop/anaconda/) 5 | 6 | The total weight of theis image is **88.97**. For comparison a `ubuntu:14.04` base image (without python) is 195 MB in size and typical python distribution needs aproximately another 100 MBs. When you add the compilation toolchain and dependencies you get the official python docker image, which is close to 900MB in size. 7 | 8 | The intended use of this recipe is to serve as base image for scientific stack (numpy, pandas, ipython, sklearn) applications where the conda packaging system shines. For an even smaller image see `elyase/pyrun` (**18.44 MB**) 9 | 10 | ### So what is missing? 11 | 12 | Nothing of importance should be missing. In order to reduce the size I used a really small base image ([progrium/busybox](https://github.com/progrium/busybox)), cleaned conda cache files, deleted python `.pyc` files (this should be automatically regenerated but depending on your use case this could affect performance) and the tests folders (unittest is still there). 13 | 14 | ### Credits 15 | 16 | [@elyase](http://yasermartinez.com) 17 | 18 | -------------------------------------------------------------------------------- /conda/3.4/anaconda_license.txt: -------------------------------------------------------------------------------- 1 | =================================== 2 | Anaconda END USER LICENSE AGREEMENT 3 | =================================== 4 | Anaconda ("the Software Product") and accompanying documentation is 5 | licensed and not sold. The Software Product is protected by copyright laws 6 | and treaties, as well as laws and treaties related to other forms of 7 | intellectual property. Continuum Analytics Inc or its subsidiaries, 8 | affiliates, and suppliers (collectively "Continuum ") own intellectual 9 | property rights in the Software Product. The Licensee's ("you" or "your") 10 | license to download, use, copy, or change the Software Product is subject 11 | to these rights and to all the terms and conditions of this End User 12 | License Agreement ("Agreement"). 13 | 14 | In addition to Continuum-licensed software, the Software product contains a 15 | collection of software packages from other sources ("Other Vendor Tools"). 16 | Continuum may also distribute updates to these packages on an "as is" basis 17 | and subject to their individual license agreements. These licenses are 18 | available either in the package itself or via request to info@continuum.io. 19 | Continuum reserves the right to change which Other Vendor Tools are 20 | provided in Anaconda. 21 | 22 | Attribution License 23 | =================== 24 | Redistribution and derivative use of Anaconda, with or without 25 | modification, in source or binary form is explicitly permitted provided 26 | that: 27 | 28 | 1. You include a copy of this EULA in all copies of the derived software. 29 | 2. In advertising and labeling material for products built with Anaconda 30 | you mention that your product either includes or derives from Anaconda. 31 | "Powered by Anaconda" is the suggested phrase. 32 | 33 | 34 | Export Regulations 35 | ================== 36 | Any use or distribution of Anaconda is made under conditions that the user 37 | and/or distributor is in full compliance with all export and other 38 | governing laws of the United States of America, including full and ongoing 39 | compliance with the Export Administration Regulations (EAR) of the United 40 | States Department of Commerce. See www.commerce.gov/ and 41 | http://www.bis.doc.gov/index.php/regulations/export-administration- 42 | regulations-ear. Use or distribution of Continuum software products to any 43 | persons, entities or countries currently under US sanctions is strictly 44 | prohibited. Anaconda is classified with an ECCN of 5D992 with no license 45 | required for export to non-embargoed countires. 46 | 47 | The United States currently has embargoes against Cuba, Iran, North Korea, 48 | Sudan and Syria. The exportation, re-exportation, sale or supply, directly 49 | or indirectly, from the United States, or by a U.S. person wherever 50 | located, of any Continuum software to any of these countries is strictly 51 | prohibited without prior authorization by the United States Government By 52 | accepting this Agreement, you represent to Continuum that you will comply 53 | with all applicable export regulations for Anaconda. 54 | 55 | No Implied Warranty or Fitness for Any Use 56 | ========================================== 57 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 58 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 59 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 60 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 61 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 62 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 63 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 64 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 65 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 66 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 67 | POSSIBILITY OF SUCH DAMAGE -------------------------------------------------------------------------------- /conda/3.4/conda_install.sh: -------------------------------------------------------------------------------- 1 | URL=http://repo.continuum.io/miniconda/Miniconda3-3.8.3-Linux-x86_64.sh 2 | 3 | # Install dir 4 | PREFIX=$HOME/miniconda3 5 | mkdir -p $PREFIX 6 | 7 | # Download Miniconda 8 | wget -q $URL -P $PREFIX 9 | 10 | # Extract packages 11 | cd $PREFIX 12 | LINES=$(cat Miniconda* | grep 'MD5=' | cut -d' ' -f3) 13 | tail -n $LINES Miniconda* | tar -xf - 14 | 15 | extract_dist() 16 | { 17 | echo "installing: $1 ..." 18 | DIST=pkgs/$(basename $1 .tar.bz2) 19 | mkdir -p $DIST 20 | bunzip2 -c ${DIST}.tar.bz2 | tar xf - -C $DIST 21 | rm -f ${DIST}.tar.bz2 22 | } 23 | 24 | for x in pkgs/*.tar.bz2; do extract_dist $x; done 25 | 26 | # Install miniconda 27 | mkdir $PREFIX/envs 28 | mkdir $HOME/.continuum 2>/dev/null 29 | 30 | PYTHON="$(ls $PREFIX/pkgs/python-*/bin/python) -E" 31 | CONDA_INSTALL=$(ls $PREFIX/pkgs/conda-*/lib/python*/site-packages/conda/install.py) 32 | $PYTHON $CONDA_INSTALL --prefix=$PREFIX --pkgs-dir=$PREFIX/pkgs --link-all 33 | 34 | # config 35 | export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PREFIX/bin 36 | conda config --set always_yes True 37 | 38 | # this is needed for libraries like sklearn 39 | conda install -c https://conda.binstar.org/zhenxieit libstdcplus 40 | 41 | ## clean to reduce image size 42 | 43 | # delete tests 44 | find . -type d -name tests -depth -exec rm -rf {} \; 45 | find . -type d -name test -depth -exec rm -rf {} \; 46 | 47 | # remove .pyc 48 | find . -name \__pycache__ -depth -exec rm -rf {} \; 49 | 50 | # remove pkgs cache 51 | rm -r pkgs/* 52 | 53 | #remove installer 54 | rm Miniconda*.sh 55 | -------------------------------------------------------------------------------- /conda/README.md: -------------------------------------------------------------------------------- 1 | elyase/conda 2 | ============ 3 | 4 | A minimal python docker image based on [progrium/busybox](https://github.com/progrium/busybox) and the [Anaconda Python Distribution](https://store.continuum.io/cshop/anaconda/) 5 | 6 | The total weight of this image is **88.97**. For comparison a `ubuntu:14.04` base image (without python) is 195 MB in size and typical python distribution needs aproximately another 100 MBs. When you add the compilation toolchain and dependencies you get the official python docker image, which is close to 900MB in size. 7 | 8 | The intended use of this recipe is to serve as base image for scientific stack (numpy, pandas, ipython, sklearn) applications where the conda packaging system shines. For an even smaller image see [`elyase/pyrun`](https://registry.hub.docker.com/u/elyase/pyrun/) (**18.44 MB**) or [`elyase/staticpython`](https://registry.hub.docker.com/u/elyase/staticpython/) 9 | (**8.5 MB**). 10 | 11 | ### So what is missing? 12 | 13 | Nothing of importance should be missing. In order to reduce the size I used a really small base image ([progrium/busybox](https://github.com/progrium/busybox)), cleaned conda cache files, deleted python `.pyc` files (this should be automatically regenerated but depending on your use case this could affect performance) and the tests folders (unittest is still there). 14 | 15 | ### Credits 16 | 17 | [@elyase](http://yasermartinez.com) 18 | 19 | -------------------------------------------------------------------------------- /pyrun/2.7/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM progrium/busybox 2 | MAINTAINER Yaser Martinez Palenzuela <@elyase> 3 | RUN opkg-install bzip2 libsqlite3 libpthread zlib libopenssl 4 | ADD pyrun2.7 /bin/python 5 | RUN ln -s /usr/lib/libbz2.so.1.0 /usr/lib/libbz2.so.1 6 | RUN ln -sf /lib/libpthread-2.18.so /lib/libpthread.so.0 -------------------------------------------------------------------------------- /pyrun/2.7/README.md: -------------------------------------------------------------------------------- 1 | docker-pyrun 2 | ============ 3 | 4 | A small [docker image]((https://registry.hub.docker.com/u/elyase/pyrun/)) for python. 5 | 6 | The total image size is **18.44 MB**. This is achieved by using the great [progrium/busybox](https://github.com/progrium/busybox) as base image and the super small [Egenix PyRun](https://www.egenix.com/products/python/PyRun/). 7 | 8 | ### Usage: 9 | 10 | ```bash 11 | $ docker run -t -i --rm elyase/pyrun:2.7 python 12 | eGenix PyRun 2.7.8 (release 2.0.1, default, Aug 26 2014, 11:43:05) 13 | [GCC 4.6.4] 14 | Thank you for using eGenix PyRun. Type "help" or "license" for details. 15 | 16 | >>> 17 | ``` 18 | 19 | For a new image create a `Dockerfile` in your Python app project: 20 | 21 | ``` 22 | FROM elyase/pyrun:2.7 23 | CMD [ "python", "./your-daemon-or-script.py" ] 24 | ``` 25 | 26 | ### FAQ: 27 | 28 | **Why?:** 29 | 30 | The official docker python image is too big (**900 MB**), the smallest python docker image runs at several hundred MBs. The reason for that is that a typical Ubuntu base image is more than 200MB in size plus ~100Mb for a basic python installation. 31 | 32 | **When is this useful?:** 33 | 34 | You have a small pure python script that you want to test/run in an isolated docker container. 35 | 36 | **Which python version is installed in the container?:** 37 | 38 | There are two image tags, one for python 2.7 and one for python 3.4. Ex: 39 | 40 | ```bash 41 | $ docker pull elyase/pyrun:3.4 42 | ``` 43 | 44 | **What are the drawbacks?:** 45 | 46 | Please refer to [PyRun's](https://www.egenix.com/products/python/PyRun/) page. Esentially: it is somewhat difficult to install dependencies and some less used modules are missing like `readline`, `tkinter`, `multiprocessing`, etc. In general everything should run like in a standard python distribution. 47 | 48 | **Can I install packages?** 49 | 50 | No, but I am planning on also making a pip compatible image. 51 | 52 | **Is this the smaller docker image for python?** 53 | 54 | No, [this one](https://registry.hub.docker.com/u/elyase/staticpython/) is smaller (**8.5MB**) 55 | 56 | ### Credits 57 | 58 | [@elyase](http://yasermartinez.com/blog/) -------------------------------------------------------------------------------- /pyrun/2.7/eGenix.com-Public-License-1.1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elyase/docker/ae1bf295df663c6602d214e6da5383b418da8d82/pyrun/2.7/eGenix.com-Public-License-1.1.0.pdf -------------------------------------------------------------------------------- /pyrun/2.7/pyrun2.7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elyase/docker/ae1bf295df663c6602d214e6da5383b418da8d82/pyrun/2.7/pyrun2.7 -------------------------------------------------------------------------------- /pyrun/3.4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM progrium/busybox 2 | MAINTAINER Yaser Martinez Palenzuela <@elyase> 3 | RUN opkg-install bzip2 libsqlite3 libpthread zlib libopenssl 4 | ADD pyrun3.4 /bin/python 5 | RUN ln -s /usr/lib/libbz2.so.1.0 /usr/lib/libbz2.so.1 6 | RUN ln -sf /lib/libpthread-2.18.so /lib/libpthread.so.0 -------------------------------------------------------------------------------- /pyrun/3.4/README.md: -------------------------------------------------------------------------------- 1 | docker-pyrun 2 | ============ 3 | 4 | A small [docker image]((https://registry.hub.docker.com/u/elyase/pyrun/)) for python. 5 | 6 | The total image size is **20.35 MB**. This is achieved by using the great [progrium/busybox](https://github.com/progrium/busybox) as base image and the super small [Egenix PyRun](https://www.egenix.com/products/python/PyRun/). 7 | 8 | ### Usage: 9 | 10 | ```bash 11 | $ docker run -t -i --rm elyase/pyrun:3.4 python 12 | eGenix PyRun 3.4.1 (release 2.0.1, default, Aug 26 2014, 11:51:10) 13 | [GCC 4.6.4] 14 | Thank you for using eGenix PyRun. Type "help" or "license" for details. 15 | 16 | >>> 17 | ``` 18 | 19 | For a new image create a `Dockerfile` in your Python app project: 20 | 21 | ``` 22 | FROM elyase/pyrun:2.7 23 | CMD [ "python", "./your-daemon-or-script.py" ] 24 | ``` 25 | 26 | ### FAQ: 27 | 28 | **Why?:** 29 | 30 | The official docker python image is too big (**900 MB**), the smallest python docker image runs at several hundred MBs. The reason for that is that a typical Ubuntu base image is more than 200MB in size plus ~100Mb for a basic python installation. 31 | 32 | **When is this useful?:** 33 | 34 | You have a small pure python script that you want to test/run in an isolated docker container. 35 | 36 | **Which python version is installed in the container?:** 37 | 38 | There are two image tags, one for python 2.7 and one for python 3.4. Ex: 39 | 40 | ```bash 41 | $ docker pull elyase/pyrun:3.4 42 | ``` 43 | 44 | **What are the drawbacks?:** 45 | 46 | Please refer to [PyRun's](https://www.egenix.com/products/python/PyRun/) page. Esentially: it is somewhat difficult to install dependencies and some less used modules are missing like `readline`, `tkinter`, `multiprocessing`, etc. In general everything should run like in a standard python distribution. 47 | 48 | **Can I install packages?** 49 | 50 | No, but I am planning on also making a pip compatible image. 51 | 52 | **Is this the smaller docker image for python?** 53 | 54 | No, [this one](https://registry.hub.docker.com/u/elyase/staticpython/) is smaller (**8.5MB**) 55 | 56 | [@elyase](http://yasermartinez.com/blog/) -------------------------------------------------------------------------------- /pyrun/3.4/eGenix.com-Public-License-1.1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elyase/docker/ae1bf295df663c6602d214e6da5383b418da8d82/pyrun/3.4/eGenix.com-Public-License-1.1.0.pdf -------------------------------------------------------------------------------- /pyrun/3.4/pyrun3.4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elyase/docker/ae1bf295df663c6602d214e6da5383b418da8d82/pyrun/3.4/pyrun3.4 -------------------------------------------------------------------------------- /staticpython/Dockerfile: -------------------------------------------------------------------------------- 1 | # The smallest docker container using busybox and 2 | # [StaticPython](https://code.google.com/p/pts-mini-gpl/wiki/StaticPython) 3 | 4 | FROM busybox 5 | MAINTAINER Yaser Martinez Palenzuela <@elyase> 6 | ADD python2.7-static /bin/python -------------------------------------------------------------------------------- /staticpython/README.md: -------------------------------------------------------------------------------- 1 | docker-staticpython 2 | ============ 3 | 4 | Probably the smallest docker image for python. 5 | 6 | The total image size is **8.5 MB**. This is achieved by using busybox 7 | as the base image and the super small [StaticPython](https://code.google.com/p/pts-mini-gpl/wiki/StaticPython). 8 | 9 | ### Usage: 10 | 11 | ```bash 12 | $ docker run -t -i --rm elyase/staticpython python 13 | Python 2.7.1 (r271:86832, Oct 30 2011, 11:44:49) 14 | [GCC 4.1.2] on linux2 15 | Type "help", "copyright", "credits" or "license" for more information. 16 | >>> 17 | ``` 18 | 19 | For a new image create a `Dockerfile` in your Python app project: 20 | 21 | ``` 22 | FROM elyase/staticpython 23 | CMD [ "python", "./your-daemon-or-script.py" ] 24 | ``` 25 | 26 | ### FAQ: 27 | 28 | **Why?:** 29 | 30 | The official docker python image is too big (**900 MB**), the smallest python docker images run at several hundred MBs. The reason for that is that a typical Ubuntu base image is more than 200MB in size plus ~100Mb for a basic python installation. 31 | 32 | **When is this useful?:** 33 | 34 | You have a small pure python script that you want to test/run in an isolated docker container. 35 | 36 | **Which python version is installed in the container?:** 37 | 38 | 2.7.2 39 | 40 | **What are the drawbacks?:** 41 | 42 | Please refer to [StaticPython's](https://code.google.com/p/pts-mini-gpl/wiki/StaticPython) main page. Esentially: no dependencies, no .so files, and no GUI. 43 | 44 | [@elyase](http://yasermartinez.com/blog/) -------------------------------------------------------------------------------- /staticpython/python2.7-static: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elyase/docker/ae1bf295df663c6602d214e6da5383b418da8d82/staticpython/python2.7-static --------------------------------------------------------------------------------