example
1) create this Dockerfile
FROM ubuntu:trusty
ENV http_proxy "http://proxy.parkeon.com:9090"
# Install Python.
RUN \
apt-get update && \
apt-get install -y python python-dev python-pip python-virtualenv && \
rm -rf /var/lib/apt/lists/*
# Define working directory.
WORKDIR /data
# Define default command.
ENTRYPOINT ["/usr/bin/python"]
CMD ["--version"]
Build it :
docker build -t pythontrusty .
Use it :
create a python script like : test.py
#!/usr/bin/python
print ("OK")
and run it from docker python :
docker run -it --rm -v "$PWD":/data pythontrusty test.py