google/python
is a docker base image that bundles the stable version of python installed from debian stable and pip and virtualenv installed from PyPI.
It serves as a base for the google/python-runtime
image.
-
Create a Dockerfile in your python application directory with the following content:
FROM google/python WORKDIR /app RUN virtualenv /env ADD requirements.txt /app/requirements.txt RUN /env/bin/pip install requirements.txt ADD . /app CMD [] ENTRYPOINT ["/env/bin/python", "/app/main.py"]
-
Run the following command in your application directory:
docker build -t my/app .