3

I took over a project which requires the usage of docker to setup the development environment. The project wiki is primarily written for use with coreos and one of the setup steps involved running a python script.

I'm using boot2docker and realised that there's no python pre-installed with the tcl. However, the image that I've pulled from the project repository comes with python27.

How do I use the python interpreter from the container in the VM without having to type docker exec every time?

Also, how do I access the project code in the boot2docker vm (not docker) instance locally so that I can do development on an IDE?

  • 1
    I've only messed around with docker, I haven't actually done much with it. However, the workflow that I think is appropriate is to do your dev on your local system (i.e. your mac, not within the b2d vm). and publish your code into a new container to actually run it. (copy files to right place, docker build, docker run). – skarface Jun 12 '15 at 16:58
2

You can mount your local directory to the container then run it almost as if it were on your local machine. For example:

docker run --rm -v "$PWD":/app -w /app iron/python:2 python hello.py

That mounts your current directory and run hello.py from that directory.

You can find full examples of this here: https://github.com/iron-io/dockerworker/tree/master/python

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.