1

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 without having to type docker exec everytime?

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?

4
  • Ha, most of the time people want to close Docker questions on SO and send them to SF :) Commented Jun 12, 2015 at 18:00
  • @AdrianMouat see meta.stackoverflow.com/questions/276579/… Commented Jun 24, 2015 at 12:30
  • @Thomasleveil I know. But have a look at the number of Docker questions with a close flag (probably from the same one or two users to be fair). Commented Jun 30, 2015 at 9:03
  • I'm using dockershell.io for exactly that purpose. Commented Jul 3, 2015 at 20:33

1 Answer 1

1

How do I use the python interpreter from the container without having to type docker exec everytime?

What about opening a shell in that container instead?

docker exec -it <your container id> /bin/bash -l

and then from there use python.

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?

I'm not using boot2docker myself but from this note, it seems it can be done given that the files on your host are in the /Users (OSX) or C:\Users (Windows) directory

Note: If you are using Boot2Docker, your Docker daemon only has limited access to your OSX/Windows filesystem. Boot2Docker tries to auto-share your /Users (OSX) or C:\Users (Windows) directory - and so you can mount files or directories using docker run -v /Users/<path>:/<container path> ... (OSX) or docker run -v /c/Users/<path>:/<container path ... (Windows). All other paths come from the Boot2Docker virtual machine's filesystem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.