Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Introduction to Docker Why Docker? Building an Image and Running a Container

Landon Wiedenman
Landon Wiedenman
5,629 Points

When I run mongo in a second terminal window I get a command not found error. Any idea how to trouble shoot?

  • Running Mac OS X.

  • I was able to install mongo manually and make it work but it seems like that is not the purpose of docker...

see answer for question "Access shell of mongotest". You will need to access the shell of the container that was created and not just 'another terminal' to run mongo

1 Answer

docker exec -it [containerName] mongo

To see the containerName you can go docker ps and check for container with IMAGE mongotest

Michael Hall
Michael Hall
Courses Plus Student 30,909 Points

for anyone else coming here:

This worked for me: docker exec -it [CONTAINER ID] mongo