2017/09/05 gg_hatano pointed out typo and corrected it. Many thanks.
As an environment for testing python3 code on Docker I wanted a python3 container, so I checked the operation.
I have an official image, so I will use it. This time I will use python 3.6.
sudo docker pull python:3.6
sudo docker run -d --name hoge python:3.6 /bin/bash -c 'tail -f /dev/null'
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.
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