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 Managing Images and Containers Managing Containers

Stefan Brandenberger
Stefan Brandenberger
4,745 Points

MongoDB doesn't start

First: please provide the two Files (Dockerfile and docker-entrypoint.sh) as Downloads. Copy/Paste from the screen is sometimes a bit unreliable (Linefeeds and so...). Then a second remark: In the Dockerfile, only Port 27017 is exposed whereas in your video you expose also 28017, when you run the container (docker run -p ... 28017:28017 ...).

But my real issue is: MongoDB doesn't start up. If I check the logs, I see there: standard_init_linux.go:187: exec user process caused "no such file or directory".

What am I doing wrong?

Working on Windows 10, if that's of interest.

Robert Durbin
Robert Durbin
1,355 Points

I just saw the download link in the teachers notes.

3 Answers

Paul Flanders
Paul Flanders
520 Points

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"docker-entrypoint.sh\": executable file not found in $PATH": unknown.

Agreed

chmod +x docker-entrypoint.sh prior to running build

Ari Misha
Ari Misha
19,323 Points

Hiya there! Thats exactly why i dont use Docker. It messes up with your system a lot especially if its a windows pc. Now regarding your issue. It looks like it couldn't find the PATH VARIABLE for Mongo. I can think of two solutions:

  • Set your Path Variable to Mongo's .exe file in your Home directory in Advanced Environment Variable Settings.

    OR

  • Uninstall your MongoDB and reinstall it again.

~ Ari

Stefan Brandenberger
Stefan Brandenberger
4,745 Points

@Robert You're right! I must have overlooked that.

@Ari Thanks for the hints. Well, MongoDB is part of the Dockerfile, so I cannot uninstall/install it solely. But anyway, I just pulled the image from dockern00b/mongodb. And that runs. Seems, something is wrong with the Dockerfile or the docker-entrypoint.sh script I copied and pasted.

Robert Durbin
Robert Durbin
1,355 Points

@stefan, I initially copy and pasted and ran into formatting issues as you did. For the docker-entrypoint.sh, I had to chmod +x in order to get it to run.