Prepare python3 environment with Docker

2017/09/05 gg_hatano pointed out typo and corrected it. Many thanks.

Purpose

As an environment for testing python3 code on Docker I wanted a python3 container, so I checked the operation.

procedure

Preparing the python3 container

I have an official image, so I will use it. This time I will use python 3.6.

sudo docker pull python:3.6

Launch python3 container

sudo docker run -d --name hoge python:3.6 /bin/bash -c 'tail -f /dev/null'

Light operation check

I will do various things in the future, so check if you can use pip etc.

sudo docker exec -it hoge /bin/bash
# pip --version
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)

I can go properly. Not listed here, but you can also install django modules I was able to execute it without any problems.

Summary

Based on the official python3 container image, python3 It seems that the construction of the test environment used can be easily executed. The size is a little less than 700MB, which is quite large as an official image It seems possible to make it smaller by making the contents.

Required modules and application code, required environment variables, etc. If you dig in, it seems that you can build it as a test environment without any special ingenuity.

Recommended Posts

Prepare python3 environment with Docker
Build Mysql + Python environment with docker
Prepare Python development environment with Atom
Build Jupyter Lab (Python) environment with Docker
Create Python + uWSGI + Nginx environment with Docker
Use python with docker
Python environment with docker-compose
Launch environment with LineBot + Heroku + Docker + Python
Virtual environment with Python 3.6
Note: Prepare the environment of CmdStanPy with docker
[Python] Build a Django development environment with Docker
Create Nginx + uWSGI + Python (Django) environment with docker
Build PyPy and Python execution environment with Docker
Install Python environment with Anaconda
Manage python environment with virtualenv
Build python3 environment with ubuntu 16.04
Build python environment with direnv
Prepare an environment to touch grib2 format files with python (Docker edition)
Virtual environment construction with Docker + Flask (Python) + Jupyter notebook
Japanese can be used with Python in Docker environment
[Python] OpenCV environment construction with Docker (cv2.imshow () also works)
Prepare pipenv environment with amazon Linux 2
Get started with Python! ~ ① Environment construction ~
Prepare Python development environment on Ubuntu
Build python virtual environment with virtualenv
Create a virtual environment with Python!
Building a virtual environment with Python 3
Build PyPy execution environment with Docker
Python3 environment construction with pyenv-virtualenv (CentOS 7.3)
pytorch @ python3.8 environment construction with pipenv
Docker environment update: add Python package
Rebuild Django's development environment with Docker! !! !! !!
Data science environment construction with Docker
[docker] python3.5 + numpy + matplotlib environment construction
Application development with Docker + Python + Flask
Prepare the development environment with anyenv
Prepare Python development environment with Mac + Windows + VisualStudio Code (Windows version)
Prepare Python development environment with Mac + Windows + VisualStudio Code (Mac version)
Create a simple Python development environment with VSCode & Docker Desktop
[Pyenv] Building a python environment with ubuntu 16.04
[Ubuntu 18.04] Python environment construction with pyenv + pipenv
[Python] Building an environment with Anaconda [Mac]
Change Python 64bit environment to 32bit environment with Anaconda
Building a Python3 environment with Amazon Linux2
[Development environment] Python with Xcode [With screen transition]
Statistics with python
Use smbus with python3 under pyenv environment
Using venv in Windows + Docker environment [Python]
Python environment construction
Behind the flyer: Using Docker with Python
python environment settings
Python with Go
python windows environment
Note when creating an environment with python
[Python] Create a virtual environment with Anaconda
Environment construction (python)
Twilio with Python
Integrate with Python
Connect to MySQL with Python within Docker
Get a local DynamoDB environment with Docker
Play with 2016-Python